Random variables
A random variable X assigns a number to each outcome of a random process. A discrete one takes separate values, such as the number of heads. Its probability distribution lists each value with its probability; the probabilities must be between 0 and 1 and sum to 1.
Expected value
The expected value (mean) is the long-run average:
E(X) = Σ x · P(x)
It need not be a possible value of X.
Worked example 1: expected value
A game costs nothing to enter. You win $10 with probability 0.2 and lose $3 with probability 0.8.
E(X) = 10(0.2) + (−3)(0.8) = 2 − 2.4 = −$0.40
On average you lose 40 cents per play. A fair game has an expected value of 0.
Another: X takes the values 1, 2, 3 with probabilities 0.2, 0.5, 0.3. E(X) = 0.2 + 1.0 + 0.9 = 2.1, even though 2.1 is not a value X can take.
The binomial distribution
Count the number of "successes" in a fixed number of trials. A binomial setting needs:
- A fixed number of trials, n.
- Each trial has two outcomes (success or failure).
- Trials are independent.
- The probability of success, p, is the same on every trial.
Then:
P(X = k) = C(n, k) · pᵏ · (1 − p)ⁿ⁻ᵏ
where C(n, k) = n! / (k!(n − k)!) counts the ways to arrange the successes.
The mean is np and the standard deviation is √(np(1 − p)).
Worked example 2: binomial
A student guesses on 5 questions, each with a 30 percent chance of being right (n = 5, p = 0.3). What is P(X = 2)?
- C(5, 2) = 10
- 0.3² = 0.09
- 0.7³ = 0.343
- P(X = 2) = 10 × 0.09 × 0.343 = 0.3087 ≈ 0.309
The mean is 5 × 0.3 = 1.5 and the SD is √(5 × 0.3 × 0.7) = √1.05 ≈ 1.02.
Worked example 3: small cases
Four fair coin flips, P(exactly 2 heads): C(4, 2) = 6, and (1/2)⁴ = 1/16, so P = 6/16 = 0.375. For three flips, P(no heads) = (1/2)³ = 0.125.
Checking the conditions
Number of sixes in 12 rolls of a die is binomial. The height of a randomly chosen adult is not (it is not a count of successes). Number of cards drawn until the first ace is not binomial either, since the number of trials is not fixed.
Common mistakes
- Using the binomial formula when trials are dependent.
- Forgetting the combination factor C(n, k).
- Treating the expected value as the most likely single outcome.