Variance for the Binomial distribution is similarly calculated using the n and p parameters. Let’s use the 10 fair coin flips example to try to understand how variance is calculated. Each coin flip has a certain probability of landing as heads or tails: 0.5 and 0.5, respectively.
The variance of a single coin flip will be the probability that the success happens times the probability that it does not happen: p·(1-p), or 0.5 x 0.5. Because we have n = 10 number of coin flips, the variance of a single fair coin flip is multiplied by the number of flips. Thus we get the equation:
Let’s consider our 20 multiple choice quiz again. The variance around getting an individual question correct would be p·(1-p), or 0.25 x 0.75. We then multiply this variance for all 20 questions in the quiz and get:
We would expect to get 5 correct answers, but the overall variance of the probability distribution is 3.75.
A certain basketball player has an 85% chance of making a given free throw. Uncomment
variance_baskets and set it equal to the variance of free throws made from 20 shots.
Let’s say a student has a 98% chance of arriving on time to class. Uncomment
variance_late and set it equal to the variance of days the student will arrive late to class throughout the 180 school days in a school year.