S1.5 - Discrete random variables

Syllabus
2019
Topic
S1.5
Level
AS

Learning objectives

Recognise a discrete random variable

A discrete random variable assigns a numerical value to each outcome of a random process and can take only separate, countable values. Write the random variable with a capital letter, such as XX, and a possible value with a lower-case letter, such as xx.

Situation Variable type
number of defective items in a sample discrete: 0,1,2,0,1,2,\ldots
score shown by a die discrete: one value from a fixed list
exact waiting time for a bus continuous: any value in an interval is possible

If three T-shirts are selected and XX is their median selling price, then repeated selections may produce many ordered combinations, but XX can still take only the listed price values. Different combinations that give the same median belong to the same event X=xX=x.

Discrete does not mean equally likely, and a numerical label is not automatically a random variable. The value must be determined by the random outcome; its probability distribution is a separate description introduced next.

Build and use a discrete distribution

The probability function gives the probability of each possible value, p(x)=P(X=x)p(x)=P(X=x). Every probability is between 0 and 1, and the probabilities over the complete support of XX add to 1.

F(x0)=P(Xx0)=xx0p(x)F(x_0)=P(X\le x_0)=\sum_{x\le x_0}p(x)

xx 0 1 2
p(x)p(x) 0.20 0.50 0.30
F(x)F(x) 0.20 0.70 1.00

To construct a distribution, list every possible value, combine the probabilities of all disjoint routes that produce that value, and check the final probabilities total 1. To recover a probability from a cumulative distribution, subtract adjacent cumulative totals: here P(X=1)=F(1)F(0)=0.700.20=0.50P(X=1)=F(1)-F(0)=0.70-0.20=0.50.

Translate an event before reading the table. For example, P(3X3<X+2)=P(X<2.5)=P(X2)=1P(3X-3<X+2)=P(X<2.5)=P(X\le2)=1 for this integer-valued support. A non-integer cutoff is handled by including precisely the supported values that satisfy the inequality.

Do not confuse P(X=x)P(X=x) with P(Xx)P(X\le x). A discrete CDF is a non-decreasing step function: it stays constant between possible values and eventually reaches 1. When the support has gaps, subtract cumulative probabilities at successive supported values, not blindly at x1x-1.

Calculate expectation and variance

The expectation E(X)E(X) is the probability-weighted long-run mean of a discrete random variable. Variance measures its expected squared spread about that mean.

E(X)=xp(x),E(X2)=x2p(x),Var(X)=E(X2)[E(X)]2E(X)=\sum xp(x),\qquad E(X^2)=\sum x^2p(x),\qquad \operatorname{Var}(X)=E(X^2)-[E(X)]^2

For X=0,1,2X=0,1,2 with probabilities 0.20,0.50,0.300.20,0.50,0.30,E(X)=0(0.20)+1(0.50)+2(0.30)=1.10,E(X)=0(0.20)+1(0.50)+2(0.30)=1.10,E(X2)=02(0.20)+12(0.50)+22(0.30)=1.70.E(X^2)=0^2(0.20)+1^2(0.50)+2^2(0.30)=1.70.Therefore Var(X)=1.701.102=0.49\operatorname{Var}(X)=1.70-1.10^2=0.49, and the standard deviation is 0.49=0.70\sqrt{0.49}=0.70.

E(aX+b)=aE(X)+b,Var(aX+b)=a2Var(X)E(aX+b)=aE(X)+b,\qquad \operatorname{Var}(aX+b)=a^2\operatorname{Var}(X)

If Y=53XY=5-3X, then E(Y)=53(1.10)=1.70E(Y)=5-3(1.10)=1.70 and Var(Y)=(3)2(0.49)=4.41\operatorname{Var}(Y)=(-3)^2(0.49)=4.41. Adding a constant shifts every value without changing spread; multiplying by aa multiplies every deviation by aa, so variance is multiplied by a2a^2.

Do not calculate variance as E(X2)E(X)E(X^2)-E(X) or as E(X2)E(X2)E(X^2)-E(X^2). Expectation may be a value the variable never actually takes, and variance is in squared units; use the standard deviation when a spread in the original units is required.

Use a discrete uniform distribution

A discrete uniform distribution has a finite set of possible values that are all equally likely. If there are nn values, each has probability 1/n1/n.

E(X)=x1n,Var(X)=x21n[E(X)]2E(X)=\sum x\frac1n,\qquad \operatorname{Var}(X)=\sum x^2\frac1n-[E(X)]^2

Suppose BB is equally likely to be 1,3,51,3,5 or 77. ThenE(B)=1+3+5+74=4,E(B)=\frac{1+3+5+7}{4}=4,E(B2)=12+32+52+724=21,E(B^2)=\frac{1^2+3^2+5^2+7^2}{4}=21,so Var(B)=2142=5\operatorname{Var}(B)=21-4^2=5. Symmetry also shows immediately that the mean is the midpoint, 4.

For equally likely consecutive integers a,a+1,,ba,a+1,\ldots,b, the number of values is n=ba+1n=b-a+1 and the mean is (a+b)/2(a+b)/2. The variance may be found from the same E(X2)[E(X)]2E(X^2)-[E(X)]^2 method, which remains valid for any explicitly listed uniform support.

Uniform means equal probability for each listed value, not equal spacing alone. A set of equally spaced scores with unequal probabilities is not a discrete uniform distribution.