Repeating a two-outcome trial
The binomial distribution and its formula
Write X for the number of successes obtained over the n repetitions. The distribution of X is called the binomial distribution.
The formula
n-k
P(X = k) = C(n,k) · p^k · (1-p)
for k from 0 to n. We write X ~ B(n , p).
Where it comes from
The three factors can be read straight off the tree:
p^k the probability of the path's k successes
(1-p)^(n-k) that of its n-k failures
C(n,k) the NUMBER of paths with exactly k successes
(choosing in which k of the n repetitions the success falls)
This is the binomial coefficient of Pascal's triangle in its most concrete role: counting the possible positions of the successes in the sequence.
A worked example
A machine produces 20 % defective parts. Five are taken. Let X be the number of defective ones.
X ~ B(5 ; 0.2)
P(X = 2) = C(5,2) × 0.2² × 0.8³
= 10 × 0.04 × 0.512
= 0.2048
About a 20 % chance of getting exactly two defective parts out of five.
The full distribution:
k 0 1 2 3 4 5
P(X=k) 0.3277 0.4096 0.2048 0.0512 0.0064 0.0003
total = 1 ✔
P(X=k)
0.41 | █
0.33 | █ █
0.20 | █ █ █
0.05 | █ █ █ █
0.00 | █ █ █ █ █ █
+--0--1--2--3--4--5--> k
The recurring computations
"At least one" — always via the complementary event:
P(X ≥ 1) = 1 - P(X = 0) = 1 - (1-p)^n
Probability of getting at least one 6 in 4 rolls of a die:
1 - (5/6)⁴ = 1 - 0.4823 = 0.5177 about 52 %
This is the computation that, it is said, founded probability theory: the Chevalier de Méré had noticed the bet was slightly favourable, and asked Pascal why.
"At most" or "at least k" — add the relevant terms, or use the complement if shorter:
P(X ≤ 2) = P(X=0) + P(X=1) + P(X=2)
P(X ≥ 3) = 1 - P(X ≤ 2)
The shape of the distribution
p = 0.5 (symmetric) p = 0.2 (right-skewed) p = 0.9 (left)
___ _ _
/ \ / \_ ___/ \
__/ \__ / \___ ___/
0 n/2 n 0 n 0 n
p = 0.5: symmetric distribution;- small
p: the values cluster near 0; - large
n: the curve takes a bell shape — the announcement of the normal distribution.
Summary
X ~ B(n ; p)counts the successes overnindependent repetitions.P(X = k) = C(n,k) p^k (1-p)^(n-k).- The three factors: probability of the successes, of the failures, and the number of paths.
- "At least one" is computed as
1 - (1-p)^n. - The distribution is symmetric for
p = 0.5, skewed otherwise, and tends to a bell asngrows.

