Discrete Random Variables

AS · S1 · 3 min

A discrete random variable takes separate values, each with a probability. Its probability distribution is a table of values and probabilities that add to 11. From the table you calculate the expectation (the long-run average) and the variance (the spread), which are the two numbers every later distribution is described by.

Probability distributions

Key result

For a discrete random variable XX with values xix_i and probabilities pi=P(X=xi)p_i = P(X = x_i):

∑pi=1,E(X)=μ=∑xipi,Var⁡(X)=σ2=∑xi2pi−μ2.\sum p_i = 1, \qquad E(X) = \mu = \sum x_i p_i, \qquad \operatorname{Var}(X) = \sigma^2 = \sum x_i^2 p_i - \mu^2.

E(X)E(X) is also called the mean of XX. The standard deviation is Var⁡(X)\sqrt{\operatorname{Var}(X)}.

Method
  1. List every possible value of XX and find each probability from the situation (a sample space, a tree, or combinations).
  2. Check the probabilities sum to 11.
  3. Compute ∑xp\sum xp for the mean, then ∑x2p\sum x^2 p and subtract μ2\mu^2 for the variance.
Distribution from a game

A fair die is thrown. If it shows a 66, the player wins $5; if it shows a 44 or 55, the player wins $1; otherwise the player wins nothing. Let XX be the winnings. Find the distribution, E(X)E(X) and Var⁡(X)\operatorname{Var}(X).

Solution
xx015
P(X=x)P(X = x)12\tfrac{1}{2}13\tfrac{1}{3}16\tfrac{1}{6}

E(X)=0+13+56=76E(X) = 0 + \tfrac{1}{3} + \tfrac{5}{6} = \tfrac{7}{6}. ∑x2p=0+13+256=276=4.5\sum x^2 p = 0 + \tfrac{1}{3} + \tfrac{25}{6} = \tfrac{27}{6} = 4.5. Var⁡(X)=4.5−(76)2=4.5−1.3611=3.14\operatorname{Var}(X) = 4.5 - \left(\tfrac{7}{6}\right)^2 = 4.5 - 1.3611 = 3.14.

Finding an unknown probability
xx1234
P(X=x)P(X = x)0.20.2kk0.30.32k2k

Find kk, E(X)E(X) and Var⁡(X)\operatorname{Var}(X).

Solution

0.2+k+0.3+2k=1⇒k=160.2 + k + 0.3 + 2k = 1 \Rightarrow k = \tfrac{1}{6}.

E(X)=0.2+26+0.9+86=0.2+0.9+106=2.767E(X) = 0.2 + \tfrac{2}{6} + 0.9 + \tfrac{8}{6} = 0.2 + 0.9 + \tfrac{10}{6} = 2.767. ∑x2p=0.2+46+2.7+326=2.9+6=8.9\sum x^2 p = 0.2 + \tfrac{4}{6} + 2.7 + \tfrac{32}{6} = 2.9 + 6 = 8.9. Var⁡(X)=8.9−2.7672=1.25\operatorname{Var}(X) = 8.9 - 2.767^2 = 1.25.

Distribution from selection

Two counters are taken without replacement from a bag with 3 red and 2 blue. Let RR be the number of red counters taken. Find the distribution of RR and E(R)E(R).

Solution

P(R=0)=25⋅14=110P(R = 0) = \tfrac{2}{5} \cdot \tfrac{1}{4} = \tfrac{1}{10}; P(R=2)=35⋅24=310P(R = 2) = \tfrac{3}{5} \cdot \tfrac{2}{4} = \tfrac{3}{10}; P(R=1)=1−410=610P(R = 1) = 1 - \tfrac{4}{10} = \tfrac{6}{10}.

E(R)=0+610+610=1.2E(R) = 0 + \tfrac{6}{10} + \tfrac{6}{10} = 1.2.

A probability given as a formula

P(X=x)=x10P(X = x) = \dfrac{x}{10} for x=1,2,3,4x = 1, 2, 3, 4. Show this is a valid distribution and find E(X)E(X) and Var⁡(X)\operatorname{Var}(X).

Solution

1+2+3+410=1\tfrac{1 + 2 + 3 + 4}{10} = 1 ✓.

E(X)=1+4+9+1610=3E(X) = \tfrac{1 + 4 + 9 + 16}{10} = 3. ∑x2p=1+8+27+6410=10\sum x^2 p = \tfrac{1 + 8 + 27 + 64}{10} = 10. Var⁡(X)=10−9=1\operatorname{Var}(X) = 10 - 9 = 1.

Interpreting expectation

E(X)E(X) is the average value of XX over many repetitions, not necessarily a value XX can take. A game is fair if the expected winnings equal the cost to play.

A fair game

In the die game above, how much should the player pay per go for the game to be fair?

Solution

E(X)=76≈1.17E(X) = \tfrac{7}{6} \approx 1.17 dollars.

Watch out

Variance is ∑x2p−μ2\sum x^2 p - \mu^2, not ∑(xp)2\sum (xp)^2 or (∑xp)2\left(\sum xp\right)^2. Square the values, weight by the probabilities, then subtract the square of the mean.

Exam tip

Present the distribution as a table with the probabilities as fractions or exact decimals. Keep E(X)E(X) exact when it feeds into Var⁡(X)\operatorname{Var}(X); rounding 76\tfrac{7}{6} to 1.171.17 before squaring changes the variance in the third significant figure.

Practice

Question
  1. XX takes values −1,0,2-1, 0, 2 with probabilities 0.3,0.5,0.20.3, 0.5, 0.2. Find E(X)E(X) and Var⁡(X)\operatorname{Var}(X).
  2. A fair coin is tossed 3 times and HH is the number of heads. Tabulate the distribution and find E(H)E(H) and Var⁡(H)\operatorname{Var}(H).
  3. P(Y=y)=kyP(Y = y) = ky for y=2,3,5y = 2, 3, 5. Find kk and E(Y)E(Y).
  4. Two fair dice are thrown and MM is the larger score (or the common score). Find P(M=4)P(M = 4) and E(M)E(M).
Answers
  1. E(X)=0.1E(X) = 0.1; Var⁡(X)=0.3+0.8−0.01=1.09\operatorname{Var}(X) = 0.3 + 0.8 - 0.01 = 1.09.
  2. Probabilities 18,38,38,18\tfrac{1}{8}, \tfrac{3}{8}, \tfrac{3}{8}, \tfrac{1}{8} for 0,1,2,30, 1, 2, 3; E(H)=1.5E(H) = 1.5, Var⁡(H)=3−2.25=0.75\operatorname{Var}(H) = 3 - 2.25 = 0.75.
  3. k=110k = \tfrac{1}{10}; E(Y)=4+9+2510=3.8E(Y) = \tfrac{4 + 9 + 25}{10} = 3.8.
  4. P(M=m)=2m−136P(M = m) = \dfrac{2m - 1}{36}: P(M=4)=736P(M = 4) = \tfrac{7}{36}; E(M)=1+6+15+28+45+6636=16136≈4.47E(M) = \dfrac{1 + 6 + 15 + 28 + 45 + 66}{36} = \tfrac{161}{36} \approx 4.47.

How well do you know this?

Builds on

Where this leads

Console

Search notes, courses and tools, or run an action