In probability theory, a probability density function (PDF), or density of a continuous random variable, is a function that describes the relative likelihood for this random variable to take on a given value.
In a binomial distribution a trial can have only two possible outcomes (success or failure)
A fixed number of trials (n) is performed, with each trial independent of the prior
Because the n trials are independent, the outcome of one trial cannot help predict the outcome of another trial
The probability of a success and probability of a failure remain the same between trials
The random variable X = the number of successes obtained in the n independent trials.
If p is the probability of a success on one trial, and q is the probability of a failure on one trial
The mean = n*p
The variance = n*p*q
A function that generates binomial probabilities is given below. It represents the probability of exactly x successes in n trials in a binomial experiment.