Tutorial: Bernoulli trials and binomial random variables
(This topic is also in Section 9.2 in Finite Mathematics and Applied Calculus) I don't like this new tutorial. Take me back to the older tutorial!Resources
Binomial distribution utility  Histogram utility 
The binomial random variable
%%Note To follow this tutorial, you need to know what a random variable is. Go to the %%prevsectut to review that if necessary.
In many experiments there are only two outcomes. For instance:
 Flip a coin.
 Roll a die and determine whether it is a 5 or not.
 Determine whether there was flooding this year in Puerto Vallarta.
 Test a randomly selected circuit as it comes off an assembly line and determine whether it is defective or not.
 Select a random student from a class and determine whether the student has done her homework or not.
 Take a penalty shot in soccer and observe whether you score.
 Flip a coin 10 times; $X$ = Number of heads.
 Roll a die 100 times; $X$ = number of fives you roll.
 Provide a property in Puerto Vallarta with flood insurance for 20 years in a zone where flooding occurs every five years on average; $X$ is the number of years, during the 20year period, during which the property is flooded.
 Test 50 randomly selected circuits as they come off an assembly line in which 1% of the circuits are defective; $X$ = Number of defective circuits.
%%A Suppose, for example, that half of the students have done their hoework, and you choose two at random. If the first student you chose has done her hoework , then it is slightly less likely that the second student chosen has also done hers, as you have removed one of the diligent students from the group. Thus, the probability of success is not fixed. For $X$ to be a binomial random variable, we require that the probability of success for each trial be constant and, in particular, independent of what happened before. %%Q What about the penalty shots example?
%%A That depends. If the shooter and/or the goalie are adjusting their techniques as the shots progress, then the probability of success is likely changing, so that $X$ is not a binomial random variable. For $X$ to be a binomial random variable, we require that the probability of success for each trial be constant and, in particular, independent of what happened before.
Binomial random variable
A binomial random variable is a random variable that counts the number of successes in a sequence of a fixed number $n$ of independent Bernoulli trials with fixed probability of success. It is customary to use $p$ to denote the probability of success in each trial and $q$ to denote the probability of failure (so $q = 1p$). Examples include the four we have listed above. Suggested video for this topic:Video by the Khan Academy
A binomial random variable is a random variable that counts the number of successes in a sequence of a fixed number $n$ of independent Bernoulli trials with fixed probability of success. It is customary to use $p$ to denote the probability of success in each trial and $q$ to denote the probability of failure (so $q = 1p$). Examples include the four we have listed above. Suggested video for this topic:Video by the Khan Academy
%%Examples
Examples include the four we have listed above:
Examples include the four we have listed above:
1. \t !3! Flip a coin 10 times; $X$ = Number of heads. \\ \t $\quad n = 10; \ p = .5; \ q = .5$ \gap[40] \t #[The probability of throwing a %%head is .5][La probabilidad de tirar una %%head es .5]#
\\ 2. \t !3! Roll a die 100 times; $X$ = number of fives you roll. \\ \t $\quad n = 100; \ p = \dfrac{1}{6}; \ q = \dfrac{5}{6}$ \gap[40] \t #[The probability of rolling a six is $1/6$.][La probabilidad de tirar un seis es $1/6$.]#
\\ 3. \t !3! Provide a property in Puerto Vallarta with flood insurance for 20 years in a zone where flooding occurs every five years on average; $X$ is the number of years, during the 20year period, during which the property is flooded. \\ \t $\quad n = 20; \ p = .2; \ q = .8$ \gap[40] \t #[The probability of flooding in a given year is 1/5.][La probabilidad de inundación en un año determinado es 1/5.]#
\\ 4. \t !3! Test 50 randomly selected circuits as they come off an assembly line in which 1% of the circuits are defective; $X$ = Number of defective circuits. \\ \t $\quad n = 50; \ p = .01; \ q = .99$ \gap[40] \t #[The probability of ffinding a defective circuit is 1/100.][La probabilidad de inundaci—n en un a–o determinado es 1/100.]#
Some for you
Probability distribution of a binomial random variable
Recall from the %%prevsectut that the probability distribution of a discrete random variable $X$ assigns to each value of $X$ the probability of the event that $X$ equals that value. In particular, if $X$ is a binomial random variable, then $X$ measures the number of successes for a given number $n$ of independent Bernoulli trials, so the possible values of $X$ are $0, 1, 2, ..., n$. Thus, its probability distribution specifies the probabilities that $X = 0$, $X = 1$, ... , $X = n$. So, calculating the probability distribution of a binomial random variable means calculating the following probabilities:The probability of 0 successes: \t $P(X = 0)$,\\ The probability of 1 success: \t $P(X=1)$,\\ The probability of 2 successes: \t $P(X=2)$,\\ ... \\ The probability of $n$ successes: \t $P(X=n)$.
The formula below is derived in the textbook. To use it, you should know how to compute the binomial coefficients $C(m,n)$ (See the %%combintut). To assist you, try this
Popup factorials, permutations and combinations calculator.
Probability distribution of a binomial random variable
If $X$ is the number of successes in a sequence of $n$ independent Bernoulli trials, then
$C(n,x)$ is the number of combinations of $n$ items taken $x$ at a time, sometimes written as $\displaystyle {}_nC_x$ %%or $\binom{n}{x}$. (see the %%combintut). Also,
If $X$ is the number of successes in a sequence of $n$ independent Bernoulli trials, then
$P(X=x) = C(n,x)p^xq^{nx} \qquad$ \t
#[where][donde]#
$C(n,x)$ is the number of combinations of $n$ items taken $x$ at a time, sometimes written as $\displaystyle {}_nC_x$ %%or $\binom{n}{x}$. (see the %%combintut). Also,
$n =$ number of trials \\ $p =$ probability of success \\ $q =$ probability of failure $= 1p$
Suggested video for this topic:Video by Stephanie Glen
%%Examples
1. What is the probability of getting heads exactly twice if you flip a fair coin 6 times?
#[Using technology][El uso de la tecnología]#
To compute this and other probabilities using technology, try our Binomial distribution utility. To use to compute, say, $P(X = 2)$, enter it as a range by typing "2" in both slots:
1. What is the probability of getting heads exactly twice if you flip a fair coin 6 times?
\\ $x =$ number of successes $= 2$
\\ $n =$ number of trials $= 6$
\\ $p =$ probability of success $= .5$
\\ $q =$ probability of failure $= 1p = 1.5 = .5$
Probability of getting 2 heads $= P(X = 2)$ $= C(6, 2)(.5)^2(.5)^{62} = (15)(.25)(.0625) \approx .2344$
2. What is the probability of rolling a 6 three times if you roll a fair die five times?
\\ $x =$ number of successes $= 3$
\\ $n =$ number of trials $= 5$
\\ $p =$ probability of success $= \dfrac{1}{6}$
\\ $q =$ probability of failure $= 1p = 1\dfrac{1}{6} = \dfrac{5}{6}$
Probability of rolling a 6 three times $= P(X = 2)$ $\displaystyle = C(5, 3)\left(\dfrac{1}{6}\right)^3\left(\dfrac{5}{6}\right)^{53} = (10)\left(\dfrac{1}{216}\right)\left(\dfrac{25}{36}\right) \approx .03215$
One for you
#[Using technology][El uso de la tecnología]#
To compute this and other probabilities using technology, try our Binomial distribution utility. To use to compute, say, $P(X = 2)$, enter it as a range by typing "2" in both slots:

$P(\box{\ \ 2 \ \ } \leq X \leq \box{\ \ 2 \ \ })$.
Tabulating the entire probability distribution
Now that we know how to calculate the individual probabilities $P(X = x)$, we can put them all together to obtain the complete probability distribution table. Here is an example:
Now try some of the exercises in Section 9.2 in Finite Mathematics and Applied Calculus.
Copyright © 2020 Stefan Waner and Steven R. Costenoble