Leave lesson

Statistics · Statistical distributions

1 / 10

Calculating binomial probabilities P(X = r)

The binomial probability formula P(X = r) = nCr · p^r · (1−p)^(n−r), why it has that shape (choose which r of the n trials succeed, then multiply the success and failure probabilities), how to evaluate it including the special cases r = 0 and r = n, and how it matches the binompdf function on a calculator.

Statistics · Statistical distributions

Calculating binomial probabilities P(X = r)

The binomial probability formula P(X = r) = nCr · p^r · (1−p)^(n−r), why it has that shape (choose which r of the n trials succeed, then multiply the success and failure probabilities), how to evaluate it including the special cases r = 0 and r = n, and how it matches the binompdf function on a calculator.

Why it works

For XB(n,p)X \sim B(n, p), the probability of getting exactly rr successes is

P(X=r)=(nr)pr(1p)nr,r=0,1,2,,n,P(X = r) = \binom{n}{r} p^{r} (1-p)^{n-r}, \qquad r = 0, 1, 2, \dots, n,

where (nr)=nCr=n!r!(nr)!\binom{n}{r} = {}^{n}C_{r} = \dfrac{n!}{r!\,(n-r)!} is the binomial coefficient. Writing q=1pq = 1 - p for the probability of failure, this is (nr)prqnr\binom{n}{r} p^{r} q^{\,n-r}.

Why this works. Picture one particular way to get rr successes — say the first rr trials succeed and the rest fail. That single sequence has probability

p××pr successes×q××qnr failures=prqnr,\underbrace{p \times \dots \times p}_{r \text{ successes}} \times \underbrace{q \times \dots \times q}_{n-r \text{ failures}} = p^{r} q^{\,n-r},

because the trials are independent. But the rr successes could fall in any of the positions, and the number of ways to choose which rr of the nn trials succeed is (nr)\binom{n}{r}. Each of those arrangements has the same probability prqnrp^{r} q^{\,n-r} and they are mutually exclusive, so we add them — that is, multiply by (nr)\binom{n}{r}.

The ends. P(X=0)=qnP(X = 0) = q^{n} (every trial a failure) and P(X=n)=pnP(X = n) = p^{n} (every trial a success), since (n0)=(nn)=1\binom{n}{0} = \binom{n}{n} = 1.

On a calculator. This single-value probability is binompdf(n, p, r). Use it directly for "exactly", and keep full accuracy until the final rounding.