Concept map / Binomial and normal distributions
Share
Binomial and normal distributions
Compare the binomial distribution of heads with a normal approximation and read normal probabilities as areas.
1Ten flips, counted again and again
Flip a coin ten times and count the heads. Then do it again, and again. Each set of ten flips is one experiment, and its result is a count from 0 to 10. Over many experiments the counts pile up into a shape called the binomial distribution. Each flip is a Bernoulli trial: one outcome, heads or tails.
Run some experiments and watch your blue bars close in on the green marks, the long-run share of each count. Then change n, the number of flips, or p, the chance of heads.
One experiment is 10 flips. Only the number of heads is kept.
No experiments yet. The most likely count is 5, with probability 24.6%.
More controls
2How often is the most likely count?
You flip a fair coin 10 times. Five heads is the result you would expect, and it is the single most likely one. How often do you get exactly five?
3More flips, closer to a bell
The orange curve is a normal distribution with the same center and spread as the bars. Raise n and the bars line up with it. With a lopsided coin, such as p = 0.05, the bars stay skewed for much longer.
With 10 flips at p = 0.50, the center is 10 × 0.50 = 5.0 heads and the spread is 1.58. The biggest gap between a bar and the bell's area over that bar is 0.3 percentage points.
Point at a formula to find it on the chart: the blue line is the center, and the gold bar is one spread wide.
4Shares of people are areas under the bell
Under a bell curve, a share of people is an area. Psychometrics often puts the reference population's ability on a scale with mean 0 and standard deviation 1, and this chart also assumes ability is normal. Set a range with the two sliders to find the share of people inside it.
68.3% of people have an ability between −1.00 and 1.00. A person at 1.00 is ahead of 84.1% of the population.
Preset ranges
5Check yourself
The tasks use the controls in sections 1 and 4 and tick themselves when you meet them.
- Choose n and p so that exactly 3 heads is the most likely result, then run at least 200 experiments to confirm it.Now: Most likely count: 5. 0 experiments run
- On the bell curve, set a range centered on 0 that holds 90% of people. None of the preset ranges will do it for you.Now: From −1.00 to 1.00 holds 68.3%
- Find the ability that puts a person ahead of 97.5% of the population (use the upper edge of the range).Now: Someone at 1.00 is ahead of 84.1%
6Binomial and normal probabilities in R
dbinom() gives the exact bar heights and rbinom() runs experiments like the buttons above, for the lab’s starting setup of 10 flips at p = 0.5. Exactly five heads has probability 0.246. pnorm() and qnorm() give the normal areas and the 1.96 cutoff from the last task.
Binomial probabilities and normal areasShow the code
# Ten flips of a fair coin, as on the page
n <- 10
p <- 0.5
# Exact probability of each number of heads
round(setNames(dbinom(0:n, n, p), 0:n), 3)
# Center and spread of the count
round(c(mean = n * p, sd = sqrt(n * p * (1 - p))), 2)
# Run 1,000 experiments and tabulate the share of each count
set.seed(1)
heads <- rbinom(1000, n, p)
table(factor(heads, levels = 0:n)) / 1000
# Normal areas within 1, 2 and 3 SDs of the mean
round(pnorm(1:3) - pnorm(-(1:3)), 3)
# The ability that is ahead of 97.5% of people
round(qnorm(0.975), 2)Uses base R only.
What the two distributions show
- A binomial count adds up a fixed number of independent trials that share one chance of success. A Poisson count of events in a window rests on different assumptions.
- Even the most likely count can be unlikely: exactly five heads in ten fair flips happens 24.6% of the time.
- As the number of trials grows, the binomial bars line up with a normal curve of center np and spread √(np(1 − p)). A lopsided p, with few expected successes or failures, slows this down.
- Under a normal curve, about 68%, 95% and 99.7% of people fall within one, two and three standard deviations of the mean.
- Item response theory often puts the reference population at mean 0 and standard deviation 1, and the ability estimation lab uses that standard normal as its prior.
Recommended reading
- Introductory Statistics 2eBarbara Illowsky and Susan DeanChapter 4, discrete random variables and the binomial distribution
- Introductory Statistics 2eBarbara Illowsky and Susan DeanChapter 6, the normal distribution