There are many cases where the results of an experiment (or trial) are either it works or it doesn’t, pass/fail, success/failure. Only two possible outcomes one of which we define as success the other outcome as failure. The binomial distribution is suitable if the random variable (the set of experimental or trial outcomes) when
- the number of trials is fixed, and
- the probability of success is equal for all trials.
When we are interested in knowing the probability of exactly x successes in n trials that has a probability of success, p, on each trial, then the following formula may be useful.
$$ \large\displaystyle P\left( x,n,p \right)=\left( \begin{array}{l}n\\x\end{array} \right){{p}^{x}}{{\left( 1-p \right)}^{n-x}}$$
Note
$$ \large\displaystyle \left( \begin{array}{l}n\\x\end{array} \right)=\frac{n!}{x!(n-x)!}$$
which is the notion for n choose x and is the number of combinations of size x made from n possibilities.
Let’s look at an example and apply this formula to find a solution. Let’s say there is a large batch of motors and we know that 20% of the motors are bad. Furthermore, it is not possible to determine a good from bad motor until after an extensive test. We have time to conduct eight such tests. We select eight motors to test randomly from the batch for inspection.
We are interested in knowing the probability of finding exactly two bad motors out of the eight tested. If the motors are independent of each other, meaning if one fails it does not alter the probability of another motor failing (which is true in this case.) Let’s define success as finding a bad motor – success in this context is set arbitrarily and does not have to relate only to working motors. Just stay consistent during the calculations on which outcome is considered a success.
In this example, n = 8, x = 2, and p = 0.20. Since the binomial applies as there is a fixed number of trials, the probability of success is the same for each trial, and there are only two outcomes for each trial. Using the binomial pdf formula we can solve for the probability of finding exactly two successes (bad motors).
$$ \large\displaystyle \begin{array}{l}P\left( 2,8,0.2 \right)=\left( \begin{array}{l}8\\2\end{array} \right){{0.2}^{2}}{{\left( 1-0.2 \right)}^{8-2}}\\=\frac{8!}{2!(8-2)!}(0.04)(0.2621)\\=0.2936\end{array}$$
Thus finding about a 29% chance of discovering exactly two bad motors in this experiment with 8 motors.
If we’re interested in 2 or fewer successes, then it may be easier to use the binomial cumulative distribution, which is the subject of another post. There are many ways to ask questions that would require use of the binomial pdf formula. What are your favorite type of questions? What have you seen that the binomial pdf is part of the solution?
Related:
Binomial Cumulative Density Function (article)
Common formulas (article)
Hypothesis Tests for Proportion (article)
Leave a Reply