A variable whose value is decided by chance
A random variable is a quantity whose value depends on the outcome of an experiment — the score on a die, the number of faulty items in a batch, the number of heads in four tosses. It is written with a capital letter, X, while a particular value it might take is written with a small letter, x.
The variable is discrete when the values it can take are separate and countable. Scores on a die are discrete; the exact height of a person is not, because between any two heights there is another.
The probability distribution is the complete list of the values X can take together with the probability of each. Because the list covers every possibility and no two can happen at once, the probabilities must add to exactly 1 — which is the fact almost every question uses to find a missing value.
- X
- the random variablecapital letter, the quantity itself
- x
- a value it can takesmall letter, one particular outcome
- P(X = x)
- the probability of that valueread as "the probability that X takes the value x"
The total is your free equation
When a distribution is given with an unknown in it — often k or a — you are always meant to use ΣP(X = x) = 1 to find it. This is the opening mark of most questions in the topic, and it is worth writing the sum out in full before solving.
Expectation is a balance point
The expected value E(X) is the long-run average of X over very many repetitions. It is calculated by weighting each value by its probability and adding.
Two things about it surprise people, and both are worth confronting directly. First, E(X) need not be a value X can actually take — the expected score on a fair die is 3.5, which no die ever shows. Second, it is not the most likely value; it is the balance point of the distribution, the place a ruler carrying the probabilities as weights would sit level.
- E(X)
- the mean, μthe balance point of the distribution
- E(X²)
- Σx²P(X = x)square the values, keep the probabilities as they are
- Var(X)
- the variance, σ²a measure of spread, never negative
The pivot marks E(X). On Skewed, weighting the low values drags the balance point left. On Two peaks, E(X) lands at 3.5 where almost no probability sits at all — proof that the mean is not the most likely value.
Variance: the mean of the squares minus the square of the mean
Variance measures spread. The definition is the average squared distance from the mean, but the version used in practice is the rearranged one above, because it needs only one pass through the table.
The order of operations is what people get wrong. E(X²) means square each value and weight by its probability. [E(X)]² means find the mean first and then square it. These are different numbers, and the variance is the gap between them.
The random variable X has P(X = 1) = 0.2, P(X = 2) = 0.5, P(X = 3) = k. Find k, then E(X) and Var(X).
- The probabilities sum to 1: 0.2 + 0.5 + k = 1, so k = 0.3.Always the first step when a distribution contains an unknown.
- E(X) = 1(0.2) + 2(0.5) + 3(0.3) = 0.2 + 1.0 + 0.9 = 2.1.Each value multiplied by its own probability, then added.
- E(X²) = 1(0.2) + 4(0.5) + 9(0.3) = 0.2 + 2.0 + 2.7 = 4.9.The values are squared — 1, 4, 9 — while the probabilities stay exactly as they were.
- Var(X) = 4.9 − 2.1² = 4.9 − 4.41 = 0.49.E(X²) minus the square of the mean. Squaring the mean, not the values, is the second half.
- σ = √0.49 = 0.7.The standard deviation is in the same units as X, which is why it is often quoted instead of the variance.
k = 0.3, E(X) = 2.1, Var(X) = 0.49
A negative variance means an arithmetic slip
Variance is an average of squared quantities, so it can never be negative. If E(X²) − μ² comes out negative, the usual cause is squaring the probabilities instead of the values, or forgetting to square the mean. Treat a negative answer as a signal to recheck rather than something to report.
The binomial distribution
One discrete distribution appears far more than any other, because a great many situations share the same structure: a fixed number of independent trials, each either a success or a failure, with the same probability every time.
When those four conditions hold, X is binomial, written X ~ B(n, p). The probability formula counts the arrangements with ⁿCr and then multiplies by the probability of any one such arrangement.
- n
- the number of trialsfixed in advance
- p
- probability of successthe same for every trial
- ⁿCr
- the number of arrangementswhich r of the n trials succeeded
Read "at least" and "at most" carefully
P(X ⩾ 2) is easiest as 1 − P(X = 0) − P(X = 1), since the complement is far shorter than summing every remaining term. Watch the boundary: "more than 2" excludes 2 and starts at 3, while "at least 2" includes it. Getting this boundary wrong is the single most common way to lose an otherwise correct binomial answer.
The four conditions, all of which must hold
- A fixed number of trials, n, decided before starting.
- Each trial has exactly two outcomes, success or failure.
- The trials are independent — one result does not affect another.
- The probability of success p is constant across all trials.
- Sampling without replacement breaks independence and constancy, so it is not binomial unless the population is very large.