letx=

Probability and statistics

Binomial distribution

The probability of exactly k successes in n independent trials that each succeed with probability p; also gives "at most k".

P(X=k)=(nk)pk(1−p)n−k
At most k (cumulative)P(X≤k)=∑j=0k(nj)pj(1−p)n−j
Mean and standard deviationμ=np, σ=np(1−p)

Calculator

The live calculator needs JavaScript. The worked example below shows the same steps it would.

See it move

123456789100.050.10.150.20.25
  • P(X = 3) = 0.1172 (highlighted); P(X ≤ 3) = 0.1719 (all shaded bars)
  • Mean np = 5, standard deviation √(np(1 − p)) = 1.581

What the symbols mean

P(X=k)
the probability of exactly k successes
P(X≤k)
the cumulative probability of at most k successes, P(X≤k)
n
the number of trials
k
the number of successes (0 to n)
p
the probability of success on each trial

When to use it

Use it when four conditions hold: a fixed number of trials n, each with two outcomes, the same success probability p every time, and trials independent of each other. Coin tosses, free throws, defective items in a batch and multiple-choice guessing all fit. For "at least k", use 1−P(X≤k−1).

Worked example

A fair coin is tossed 10 times. What is the probability of exactly 3 heads? (n = 10, k = 3, p = 0.5)

  1. Start from the formula.

    P(X=k)=(nk)⁢pk·(1−p)n−k
  2. Substitute n = 10, k = 3, p = 0.5 and work it out.

    P(X=k)=(103)·0.53·(1−0.5)10−3
    =120·0.125·0.57
    =15·0.0078125
    ≈0.117188
  3. On average you would expect np = 5 successes in 10 trials.

Answer P(X = 3) = 0.1171875

Why it works

Any particular sequence with k successes and n−k failures has probability pk(1−p)n−k, and there are (nk) ways to choose which trials are the successes.

Common mistakes

  • Leaving out the (nk) factor, which gives the probability of one particular order only.
  • Treating "at least 3" as "exactly 3"; use the cumulative probability and its complement.
  • Using it when trials are not independent, such as drawing cards without replacing them.