
Binomial Distributions
A discrete random variable is said to have a binomial distribution if
•There are a fixed number of independent and identical trials, n. This means that each trial
can be thought of as a draw from a population, where the drawing is done with replacement.
•Each of the ntrials has two possible outcomes, success and failure.
•The probability of success on each of the ntrials is the same, p. Therefore, the probability
of failure on each of the ntrials is 1 −p=q.
•The random variable Y is defined as the total number of successes in the ntrials.
•The parameters for a binomial random variable Y are the number of trials nand the proba-
bility of success on each trial p.
•The probability distribution function of the binomial random variable Y is
p(y) = n
y!py(1 −p)n−yfor y= 0,1,...,n
•The theoretical mean of the binomial random variable Y is
µ=E(Y) = np
•The theoretical variance of the binomial random variable Y is
σ2=V(Y) = np(1 −p) = npq
Working with binomial random variables in R.
•Finding probabilities.
To find a probability P(Y=y) = p(y) for a single value y, the command in R is
dbinom(y,n,p)
To find the probability P(Y≤y), use the sum command to add up all p(y) values for y
between and including 0 and y.
sum(dbinom(0:y,n,p))
To find the probability P(y1≤Y≤y2), use the sum command to add up all p(y) values for
ybetween and including y1and y2.
sum(dbinom(y1:y2,n,p))
To find the probability P(Y≥y), use the sum command to add up all p(y) values for y
between and including yand n
1