The binomial formula, mean and spread · Statistics &… | StemPy Lab
Course 4.2·Lesson 2 of 3
The binomial formula, mean and spread
Multiply the number of orders by the probability of one order, and you have the binomial formula P(X=k)=(kn)pk(1−p)n−k
Lesson 2 of 3Show all lessonsHide
Try the code and the simulations beside the lesson.
What you will be able to do
use the binomial formula to find the probability of a count, and of "at most" or "at least" a count;
find the mean np and the standard deviation np(1−p) of a binomial count;
say what those two numbers mean for real counts.
The formula
From the last lesson, each order with k successes has probability pk(1−p)n−k, and there are (kn) of them. So
P(X=k)=(kn)pk(1−p)n−k,k=0,1,…,n.
We write X∼B(n,p), and say "X is binomial with n trials and chance p". Some books write q for 1−p.
A packet of six seeds
Take a smaller made-up packet: 6 seeds, each growing with probability 0.8.
All six grow.P(X=6)=0.86≈0.2621.
Exactly five grow.P(X=5)=(56)×0.85×0.2=6×0.32768×0.2≈0.3932.
At most four grow. This is everything except 5 and 6: 1−0.3932−0.2621≈0.3446.
So about one packet in three has two or more seeds that fail. The company's claim of 0.8 does not promise a full packet.
Mean and standard deviation
The table of a binomial count gives its mean and spread, as for any random variable. But there is a short cut:
μ=np,σ=np(1−p).
The mean makes sense: 6 seeds at 0.8 each give 4.8 seeds on average. For the spread, σ=6×0.8×0.2=0.96≈0.98 seeds. Most packets have 4, 5 or 6 seeds that grow.
A second example. In a made-up town, 30% of adults cycle to work. A survey picks 10 adults at random. The number who cycle has μ=3 and σ=2.1≈1.449 adults. The chance of exactly 3 is (310)×0.33×0.77≈0.2668. So even the most likely count happens in only about a quarter of surveys.
You should find that the share within one standard deviation jumps as you move the sliders, because the counts are whole numbers. For many settings it is between about one half and four fifths. With n=6 and p=0.8, only the counts 4 and 5 lie within it, and together they hold about 0.639.
Try it in Python
The program builds the whole table for the seed packet from the formula. Then it finds the mean and the standard deviation from the table, and compares them with np and np(1−p).
Your turn
The usual mistakes
Leaving out (kn). Then you have the chance of one order only.
Swapping p and 1−p. The power of p is the number of successes.
Writing np(1−p) as the standard deviation. That is the variance. Take its square root.
Expecting the mean to happen. A mean of 4.8 seeds is a long-run average, not a count.
Remember these
P(X=k)=(kn)pk(1−p)n−k.
μ=np and σ=np(1−p).
For "at least" or "at most", add the terms you need, or use the complement.
Check yourself
Try each one on your own first. If you are stuck, open a hint. Then check with Show the answer.
A count is B(5,0.2). Find P(X=0).
Find the mean and the standard deviation of B(50,0.1).
A count is B(4,0.5). Find the probability of at least one success.
The seed packet has σ≈0.98 seeds. What does that tell a gardener?
Can a binomial count with n=6 have a mean of 4.8 and also be 4.8 in a packet?
References
OpenStax, Introductory Statistics, Chapter 4, section on the binomial distribution.
Enroll free in Counting Successes: The Binomial Model
Every lesson is open to read. Enrolling also lets you:
Mark lessons done and carry on where you stopped.
Take the tests of this lesson and its course.
Count the course towards the certificate for its chapter.