Explore

The binomial distribution

The number of successes in n independent trials, each a success with the same probability p. Move n and p, then ask a question: the bars it counts are shaded, and the expression shows exactly which ones.

Parameters

n = 10

n (number of trials)

p = 0.5

p (probability of success)

Ask a question

k = 3

k (threshold)

Compare with

P(X ≤ 3) = 0.1719

P(X ≤ 3) = F(3) = 0.1719

X is a count, so the boundary matters: P(X < k) = F(k − 1) and P(X ≥ k) = 1 − F(k − 1), and ≤ gives a different answer from <.

Summary

Measure B(n = 10, p = 0.5)
mean 5.0000
variance 2.5000
standard deviation 1.5811
skewness 0.0000

The same in code

Python (scipy.stats)
binom.cdf(3, 10, 0.5)
Excel
=BINOM.DIST(3, 10, 0.5, TRUE)

Formulas

Try this

0 of 4 done
  1. What rounding p costs

    Open the preset for exactly 3 of 10, then type 0.33 for p instead of 1/3.

    Look for: P(X = 3) moves from 0.2601 to 0.2614. Rounding 1/3 to 0.33 changes the answer in the third decimal, and the change grows in the tails.

  2. The off-by-one trap

    With n = 20 and p = 1/3, compare P(X ≥ 11) with P(X > 11).

    Look for: P(X ≥ 11) = 1 − F(10) = 0.0376 counts the bar at 11; P(X > 11) = 1 − F(11) leaves it out. Check which bars the words include before writing the code.

  3. The skew changes sign

    Set n = 20 and move p from 0.1 to 0.9.

    Look for: The skewness is positive while p < 0.5, zero at p = 0.5 and negative above it: the long tail points away from the nearer end.

  4. When the normal fits

    Turn on the normal approximation with p = 0.1 and raise n from 10 to 100.

    Look for: At n = 10 the bars are skewed and the curve misses them. By n = 100, where np(1 − p) = 9, the curve follows the bars closely. A common rule of thumb asks for np and n(1 − p) both at least 10.

An unhandled error has occurred. Reload ๐Ÿ—™

Reconnecting…

Your connection to Introduction to Probability Lab dropped, probably a Wi-Fi blip. Hold on while it reconnects.

The connection could not be restored. The page will reload in a few seconds.