Binomial Distribution Explorer

discrete success-count probabilities for fixed n and p

Loading interactive simulation...

Independence is the assumption that usually breaks first 🖖

The binomial needs three things to hold: a fixed number of trials, the same success probability p every time, and outcomes that do not influence one another. The first two are easy to check. The third quietly fails in most real situations.

Deal 5 cards from a deck and ask for the chance of 2 aces: the moment you draw one, p drops for every later draw, so the trials are not independent and the binomial is the wrong model β€” you need the hypergeometric. The rule of thumb is whether you are sampling with replacement or without. Put the card back and the binomial is exact; keep it and the binomial merely approximates, well when the deck is large relative to the hand and badly when it is not.

Counting successes in repeated trials 🖖

Imagine flipping the same biased coin n times and simply counting how many land heads. That count is a binomial random variable: each flip is independent, and every flip shares the same success probability p. The tool lets you slide n and p and watch where the probability piles up. Your best single guess for the number of successes is the mean, np β€” so 20 flips of a fair coin center on 10 heads.

Where the name really comes from 🖖

The "binomial" in binomial distribution is the same binomial as in algebra's binomial theorem. Expanding (p + q)n with q = 1 βˆ’ p produces exactly the terms nCk Β· pk Β· qnβˆ’k β€” the probabilities for every k. Since (p + q) = 1, that expansion equals 1n = 1, which is why the probabilities must sum to one. The coefficients nCk are literally the rows of Pascal's triangle.

BINOMIAL PROBABILITY β€” WHICH QUESTION ARE YOU ACTUALLY ASKING?

Which Binomial Case Are You In?

The binomial needs three things and no more: a fixed number of independent trials n, the same success probability p in every one of them, and a count k. What changes from problem to problem is the question β€” exactly k, or at most k β€” and the shape that p gives the distribution. Decide those two and the arithmetic is mechanical.

Exactly k with p = Β½ β€” the symmetric case P(X = k) = C(n,k) pk(1−p)n−k
At most k β€” sum the bars, do not read one P(X ≤ k) = ∑i≤k P(X = i)
p far from Β½ β€” the distribution leans μ = np, argmax P = ⌊(n+1)p⌋
Many trials, tiny p β€” the Poisson limit λ = np, P(X = k) ≈ e−λλk/k!

01

Exactly k with p = Β½ β€” the symmetric case

What you know: A fixed n, the same p in each trial, and a question about one specific count. With p = Β½ the bars are symmetric about n/2.

Formula: P(X = k) = C(n,k) pk(1−p)n−k

Worked example: n = 10, p = 0.5, k = 5 β†’ C(10,5)Β·0.5¹⁰ = 252/1024 = 0.2461

Open this case: 10 fair coin flips
Exactly k with p = Β½ β€” the symmetric case. With p = Β½ the bars are symmetric about n/2, and even the tallest takes less than a quarter of the probability. A fixed n, the same p in each trial, and a question about one specific count. With p = Β½ the bars are symmetric about n/2.
With p = Β½ the bars are symmetric about n/2, and even the tallest takes less than a quarter of the probability.

02

At most k β€” sum the bars, do not read one

What you know: The question is a threshold rather than a single count. Add every bar from 0 up to k; one P(X = k) answers a different question entirely.

Formula: P(X ≤ k) = ∑i≤k P(X = i)

Worked example: n = 40, p = 0.08, k ≀ 2 β†’ P(X ≀ 2) = 0.3694, while the single bar P(X = 2) is only 0.2100

Open this case: quality control defects
At most k β€” sum the bars, do not read one. The answer is the shaded block from 0 to k, not the height of the k-th bar. The question is a threshold rather than a single count. Add every bar from 0 up to k; one P(X = k) answers a different question entirely.
The answer is the shaded block from 0 to k, not the height of the k-th bar.

03

p far from Β½ β€” the distribution leans

What you know: A lopsided success probability. The peak sits near np and the tail on the crowded side is squashed against the boundary at n.

Formula: μ = np, argmax P = ⌊(n+1)p⌋

Worked example: n = 25, p = 0.78, k = 20 β†’ 0.1903; the mean is np = 19.5 and the mode is ⌊(n+1)pβŒ‹ = 20

Open this case: basketball free throws
p far from Β½ β€” the distribution leans. A high p pushes the peak toward n and crushes the right tail against the boundary. A lopsided success probability. The peak sits near np and the tail on the crowded side is squashed against the boundary at n.
A high p pushes the peak toward n and crushes the right tail against the boundary.

04

Many trials, tiny p β€” the Poisson limit

What you know: n is large, p is small, and their product is a modest number. The binomial and a Poisson with Ξ» = np agree to about two decimal places.

Formula: λ = np, P(X = k) ≈ e−λλk/k!

Worked example: n = 60, p = 0.03 β†’ Ξ» = 1.8; P(X ≀ 1) = 0.4592 exactly, against 0.4628 from the Poisson

Open this case: rare event process
Many trials, tiny p β€” the Poisson limit. The binomial bars and the Poisson with Ξ» = np sit almost exactly on top of one another. n is large, p is small, and their product is a modest number. The binomial and a Poisson with Ξ» = np agree to about two decimal places.
The binomial bars and the Poisson with Ξ» = np sit almost exactly on top of one another.

Problems solved in full

  1. Exactly 7 successes in 20 trials at p = 0.35 5 steps

    Exactly 7 successes in 20 trials at p = 0.35. This is the PMF view with n = 20, p = 0.35 and k = 7. Build the bar from scratch, then work out its height a second time from the standard deviation alone.

    1. The coefficient counts which 7 of the 20 trials are the successful ones, and nothing about the order they arrive in. Seven factors on top, 7! underneath β€” the cancellation is worth doing by hand once.

    2. Every specific arrangement of 7 successes and 13 failures carries the same probability, because the trials are independent and p never moves. These are its two halves.

    3. Multiply the number of arrangements by the probability of any one of them. The two probability factors together come to about 2.4 Γ— 10⁻⁢, so it takes all 77,520 arrangements to lift the answer back up to 18%.

    4. The upper tail is not the complement of the cumulative figure: 1 βˆ’ 0.6010266 would throw away k = 7, which belongs to both tails. The tool prints P(X ≀ 7) and P(X β‰₯ 7) but never P(X ≀ 6), so that subtraction is the reader's to do.

    5. Now discard the factorials. A binomial whose mean sits well away from both 0 and n has the shape of a normal curve of the same standard deviation, and a normal curve's peak height depends on nothing else.

    Answer

    The tool prints the coefficient 77,520, P(X = 7) = 0.18440119, P(X ≀ 7) = 0.6010266, P(X β‰₯ 7) = 0.58337458 and Οƒ = 2.133073. Step 5 reaches 0.18703 from Οƒ alone β€” 1.4% high, out of an expression containing neither n, nor p, nor a factorial. Raise n with p held at 0.35 and that error tracks 1/n: 0.71% at n = 40, 0.28% at n = 100, 0.07% at n = 400. So ΞΌ and Οƒ are enough to sketch every bar near the middle, and the exact formula only earns its keep out in the tails β€” at k = 0 the same normal curve is 4.7 times too high, and at k = 17 it is 43% too low. Percentage errors in the middle, factor errors at the edges: that is the shape of every normal approximation you will meet.

  2. 60 trials at 3% where np is only 1.8 6 steps

    This preset is 60 trials at 3%, and the panel gives P(X = 1) = 0.29840413. The normal approximation from the first problem is useless here β€” np is only 1.8. There is a different limit that is nearly exact, and it throws one of the two parameters away entirely.

    1. The exact answer first, straight off the panel: sixty ways to place the single success, times the one success, times fifty-nine failures.

    2. Hold the product np fixed and call it Ξ». That is the only quantity that is going to survive the limit.

    3. Take the combination term. Write p as Ξ»/n, and the falling factorial divided by nᡏ tends to 1 as n grows β€” every factor is n minus something small, over n. What is left is λᡏ over k factorial.

    4. The failure term is the definition of e in disguise: (1 βˆ’ Ξ»/n) to the n tends to e^(βˆ’Ξ»), and the extra k in the exponent stops mattering.

    5. Put the two halves back together at k = 1.

    6. Now measure the error instead of asserting it is small.

    Answer

    0.29754 against the exact 0.29840 β€” 0.29% low, at only sixty trials. The Poisson limit keeps Ξ» = np and forgets n and p separately, which is exactly why it describes situations where you never knew n at all: calls arriving at a switchboard, mutations per genome, typos per page. There is no trial count in any of those, only a rate. And the error falls like 1/n β€” at 600 trials of 0.3% it is 0.030%, at 6000 of 0.03% it is 0.003%. Ten times more trials, one tenth the error, with Ξ» never moving.

Learning path

From counts to curves

Leads to Poisson the exact distribution of a count: n independent trials, each with the same probability p.

References (2)

Example problems

  • 10 fair coin flips - Five heads in ten flips is the single most likely outcome, and it still happens under a quarter of the time: 0.2461. The most probable value of a binomial is usually not a probable value.
  • quality control defects - Forty units at an 8% defect rate averages 3.2 defects, so accepting a batch only when it has two or fewer rejects most batches that are behaving exactly as expected β€” the cumulative probability is 0.3694.
  • basketball free throws - A 78% shooter over 25 attempts averages 19.5 made. Landing on exactly 20 is the nearest whole number to that average and still only happens 19% of the time, which is how wide the distribution is at this n.
  • rare event process - Sixty trials at 3% averages 1.8 successes, so "at most one" is not the quiet outcome it sounds like: it happens 46% of the time, and getting none at all happens 16%.