When is a count binomial? · Statistics & Data Science… | StemPy Lab
Course 4.2·Lesson 1 of 3
When is a count binomial?
Many counts come from the same yes or no trial repeated: seeds that grow, people who say yes, parts that pass a test. Such a count is binomial when four conditions hold. We check the conditions on real-looking cases and count the orders of successes with a tree, with (kn)
Lesson 1 of 3Show all lessonsHide
Try the code and the simulations beside the lesson.
What you will be able to do
check the four conditions of a binomial setting, and spot the one that fails;
count the orders that give k successes in n trials with a tree and with (kn);
find the probability of one particular order.
Ten seeds in a packet
A made-up seed company says that each of its tomato seeds grows with probability 0.8. You plant a packet of 10 seeds and count how many grow. The count X is a random variable. It can be any whole number from 0 to 10. Which counts are likely?
Each seed is a trial with two outcomes. We call one of them a success (the seed grows) and the other a failure. The words do not judge. A "success" can be a faulty part, if that is what we count.
The four conditions
A count of successes is binomial when all four of these hold.
Two outcomes. Each trial is a success or a failure.
Independent trials. One trial does not change the chances of another.
A fixed number of trials. The number n is decided before you start.
The same chance. Each trial has the same probability of success, p.
Some books remember them as BINS: binary, independent, number fixed, same chance. The seed packet passes, if the seeds do not affect each other. Here n=10 and p=0.8.
Here are cases that fail, one condition each.
Roll a die until a six appears, and count the rolls. The number of trials is not fixed.
A player takes 20 shots and grows tired, so later shots score less often. The chance is not the same.
Pick 3 students from a class of 12 without putting anyone back, and count the girls. Each pick changes the class, so the trials are not independent.
When a small group breaks independence
Picking without putting back does change the chances. But if the group is large, the change is tiny. The simulation shows how tiny.
You should find that with 20 people and a share of 0.4, the chance drops from 0.4 to about 0.368 after one liker is picked. With 200 people it drops only to about 0.397. A common rule: if the sample is less than 10% of the group, treat the picks as independent.
Counting the orders
Take 3 seeds, each growing with probability p, and write S for a seed that grows and F for one that does not. The tree has 2×2×2=8 paths.
A tree diagram for three seeds. From the start, two branches lead to S, a seed that grows, with probability p, and F, a seed that does not, with probability 1 - p. Each node branches the same way twice more, giving eight paths from SSS to FFF, each labelled at the right.
Exactly two seeds grow on three paths: SSF, SFS and FSS. Each path has two S and one F, so each has probability p×p×(1−p). So P(X=2)=3p2(1−p).
For n trials, the number of orders with exactly k successes is written (kn), read "n choose k". It counts the ways to choose which k of the n trials are the successes. For n=3 the numbers are 1, 3, 3 and 1. They are a row of Pascal's triangle, where each number is the sum of the two above it. Python gives them with math.comb(n, k).
Try it in Python
The program lists every order of 4 trials, groups the orders by the number of successes, and compares each count with math.comb.
Your turn
The usual mistakes
Using the binomial when n is not fixed. "Until the first success" is not binomial.
Forgetting that every order counts. SSF, SFS and FSS are three different results with the same count.
Treating picks from a small group as independent. Check the 10% rule.
Thinking "success" means something good. It only names the outcome you count.
Remember these
Binomial: two outcomes, independent trials, a fixed n, the same p.
One order with k successes has probability pk(1−p)n−k.
There are (kn) such orders, a number from Pascal's triangle.
Check yourself
Try each one on your own first. If you are stuck, open a hint. Then check with Show the answer.
A made-up shop checks 15 eggs from a huge delivery, and each egg is cracked with probability 0.02. It counts the cracked eggs. Is the count binomial?
How many orders give exactly 3 successes in 5 trials?
Each trial succeeds with probability 0.7. What is the probability of the order S, S, F?
A player takes 10 shots, and her chance of scoring rises as she warms up. Which condition fails?
Pascal's triangle has the row 1,4,6,4,1. Write the next row.
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.