Paper ZeroSign in

IB Maths Analysis and Approaches SL

Discrete random variables and expected value: question types and practice

Discrete random variables and expected value carried 4% of the marks in the 20 recent exams, through 3 kinds of question. The one worth the most marks is Probability distribution tables.

Syllabus: AA SL 4.7: discrete random variables and their probability distributions, given as a table or as a formula for P(X=x)\mathrm{P}(X = x); the expected value (mean) E(X)\mathrm{E}(X) of a discrete random variable, and its applications. The IB guide's own application: E(X)=0\mathrm{E}(X) = 0 means a fair game, where XX is the gain of one of the players. The probabilities themselves come from SL 4.5 (equally likely outcomes, complements) and SL 4.6 (combined events, sample space diagrams, tree diagrams, independent events).
Papers: Both, about equally. 17 of the 20 exam versions have a question on this guide's types: most or all of a Section A question, or part or all of a Section B one (the whole of 3 of the 10 Section B questions; otherwise one to three parts, usually in the second half). On Paper 1 the numbers are exact: fractions or short decimals, a quadratic in kk that factorises, and the orders of an outcome counted by hand. On Paper 2 the unknown may need the GDC (a cubic in kk, a pair of equations), the context is usually money or points, and an answer is exact or to 3 significant figures. E(X)\mathrm{E}(X) is a written sum on both papers: the sum with its terms is the method mark.
Scope: AA SL only. The variance of a discrete random variable, and E(aX+b)\mathrm{E}(aX + b) and Var(aX+b)\mathrm{Var}(aX + b), are AHL 4.14: at SL, when a game's prizes change, write the new table (a fixed cost can still come straight off the expected prize, and the organiser's expected profit is the players' expected loss). Continuous random variables and probability density functions are AHL 4.14 too. Counting here never goes beyond "in how many orders can this happen?": (nr)\binom{n}{r} for rr of one result and n−rn - r of another, or a short list of the orders; arrangements and committees are AHL 1.10. A count of successes in nn independent trials, found on the GDC, is the binomial distribution (SL 4.8, Binomial probabilities).
Formula booklet: E(X)=∑x P(X=x)\mathrm{E}(X) = \sum x\,\mathrm{P}(X = x) (SL 4.7); P(A)=n(A)n(U)\mathrm{P}(A) = \frac{n(A)}{n(U)} and P(A)+P(A′)=1\mathrm{P}(A) + \mathrm{P}(A') = 1 (SL 4.5); combined, mutually exclusive, conditional and independent events (SL 4.6).

  • Not given: that the probabilities of a distribution add up to 11 and each lies between 00 and 11; that a fair game has E(gain)=0\mathrm{E}(\text{gain}) = 0; that the expected total over nn repeats is n E(X)n\,\mathrm{E}(X); what "at least", "fewer than" and "more than" mean for a whole-number variable; that an outcome made of different results can happen in several orders.

Try one now

A Discrete random variables and expected value question of the type "Probability distribution tables". Work it out on paper, then type your answer here.

No calculator[2]

The random variable XX has this probability distribution.

xxP(X=x)\mathrm{P}(X = x)
000.050.05
113k3k
220.350.35
332k2k
44kk

Find the value of kk.

Free, with no account. You see where each mark went.

The 3 question types

  1. Probability distribution tables

    Find the unknown, then E(X) and probabilities

    • In 14 of 20 recent exams
    • 2% of the marks

    Paper 1 (no calculator) and Paper 2 (calculator) (6 and 8 of its 14 exam versions), 1–5 marks per part, usually 2. Half the time it is in a Section A question of 5–6 marks, usually most or all of it, and half the time part of a Section B question, usually the opening parts. Very common (14 of 20 exam versions), and it is the step the other two types in this guide end with.

  2. Expected value in context

    Fair games, totals and the least number

    • In 7 of 20 recent exams

    Paper 2 (calculator) mostly (5 of its 7 exam versions), 1–6 marks per part: usually the last parts of a Section B question about a game, prize tickets or sales. Common (7 of 20 exam versions).

  3. Build the distribution from the experiment

    List the outcomes that qualify

    • In 5 of 20 recent exams

    Paper 1 (no calculator) mostly (4 of its 5 exam versions), 1–6 marks per part: usually the later parts of a Section B question, after a table or tree part and sometimes before an expected-value part; once it opens the question. Typical (5 of 20 exam versions).

The ideas you need

Discrete random variables and their distributions

A random variable XX is a number decided by chance: the score on a die, the number of heads in three tosses, a player's gain in a game. It is discrete when its values can be listed, such as 0,1,2,30, 1, 2, 3 or −3,1,5,9-3, 1, 5, 9. Capital XX is the variable and small xx is one of its values, so P(X=2)\mathrm{P}(X = 2) is "the probability that XX takes the value 22".

Its probability distribution gives every value with its probability, as a table or as a formula (SL 4.7). Two fair coins, with XX the number of heads (TTTT; HTHT or THTH; HHHH):

xxP(X=x)\mathrm{P}(X = x)
0014\frac{1}{4}
1112\frac{1}{2}
2214\frac{1}{4}

A formula does the same job: P(X=x)=x10\mathrm{P}(X = x) = \frac{x}{10}, for x=1,2,3,4x = 1, 2, 3, 4.

The two facts every distribution obeys (neither is in the booklet):

  1. Each probability is between 00 and 11: 0≤P(X=x)≤10 \le \mathrm{P}(X = x) \le 1.
  2. The probabilities add up to 11: ∑P(X=x)=1\sum \mathrm{P}(X = x) = 1, because exactly one of the values happens. For the formula above, 110+210+310+410=1\frac{1}{10} + \frac{2}{10} + \frac{3}{10} + \frac{4}{10} = 1 ✓.

Fact 2 turns a table with an unknown into an equation; fact 1 decides which of its solutions are allowed. A table with an entry of −0.1-0.1, or with entries that add up to 1.11.1, is not a distribution.

  • The value x=0x = 0 still counts. Its probability is part of the total of 11, even though it adds nothing to E(X)\mathrm{E}(X).
  • The mode is the value of XX with the greatest probability. For the coins it is 11 (the value), not 12\frac{1}{2} (its probability).
  • A formula is a table in disguise. Work out P(X=x)\mathrm{P}(X = x) for each value of xx and write the table before doing anything else.

Mini-example: is P(X=x)=x−16\mathrm{P}(X = x) = \frac{x - 1}{6}, for x=1,2,3,4x = 1, 2, 3, 4, a probability distribution? The probabilities are 0,16,26,360, \frac{1}{6}, \frac{2}{6}, \frac{3}{6}. Each is between 00 and 11 (a probability of 00 is allowed), and they add up to 66=1\frac{6}{6} = 1 ✓. So yes, and its mode is 44.

P(X=x)=x−16\mathrm{P}(X = x) = \frac{x - 1}{6} for x=1,2,3,4x = 1, 2, 3, 4: every bar is between 00 and 11 (a bar of height 00 is allowed) and the four add to 11, so it is a distribution. The tallest bar is at x=4x = 4: the mode is 44.

Inequality words for a whole-number variable

When XX takes whole-number values, each phrase has an exact translation, and "fewer than" and "at most" are different. Translate before adding anything up. Binomial probabilities uses the same translations, with the binomial cdf (P(X≤k)\mathrm{P}(X \le k), from the GDC's binomial probabilities) in place of adding the entries.

  • exactly 33
    Means
    X=3X = 3
    Values, when XX can be 0,1,…,50, 1, \ldots, 5
    33
  • at most 33, no more than 33
    Means
    X≤3X \le 3
    Values, when XX can be 0,1,…,50, 1, \ldots, 5
    0,1,2,30, 1, 2, 3
  • fewer than 33, less than 33
    Means
    X≤2X \le 2
    Values, when XX can be 0,1,…,50, 1, \ldots, 5
    0,1,20, 1, 2
  • at least 33, no fewer than 33
    Means
    X≥3X \ge 3
    Values, when XX can be 0,1,…,50, 1, \ldots, 5
    3,4,53, 4, 5
  • more than 33, greater than 33
    Means
    X≥4X \ge 4
    Values, when XX can be 0,1,…,50, 1, \ldots, 5
    4,54, 5
  • between 11 and 33 inclusive
    Means
    1≤X≤31 \le X \le 3
    Values, when XX can be 0,1,…,50, 1, \ldots, 5
    1,2,31, 2, 3
  • A cut-off that isn't a whole number can't be a value of XX, so strict and non-strict agree: X>2.5X > 2.5 means X≥3X \ge 3, and X<2.5X < 2.5 means X≤2X \le 2.
  • The complement is often shorter: P(X≥3)=1−P(X≤2)\mathrm{P}(X \ge 3) = 1 - \mathrm{P}(X \le 2), and "at least one" is 1−P(X=0)1 - \mathrm{P}(X = 0). Markschemes accept the direct sum or the complement.
  • Continuous variables are different. For a normal variable P(X=3)=0\mathrm{P}(X = 3) = 0, so << and ≤\le give the same probability (Normal probabilities). The care over strict and non-strict is for discrete variables.
  • A data boundary is different again. An outlier fence, such as Q3+1.5×IQRQ_3 + 1.5 \times \mathrm{IQR}, is built from the quartiles of a data set, not translated from words. A value exactly on it is not an outlier, because an outlier is more than 1.5×IQR1.5 \times \mathrm{IQR} beyond its quartile (Outliers: the 1.5 × IQR fences).

Mini-example:

xxP(X=x)\mathrm{P}(X = x)
000.050.05
110.10.1
220.250.25
330.30.3
440.20.2
550.10.1
  • fewer than 33: P(X≤2)=0.05+0.1+0.25=0.4\mathrm{P}(X \le 2) = 0.05 + 0.1 + 0.25 = 0.4
  • at least 33: 1−0.4=0.61 - 0.4 = 0.6 (the complement of the line above)
  • more than 33: P(X≥4)=0.2+0.1=0.3\mathrm{P}(X \ge 4) = 0.2 + 0.1 = 0.3
  • between 11 and 33 inclusive: 0.1+0.25+0.3=0.650.1 + 0.25 + 0.3 = 0.65
  • X>2.5X > 2.5: the same event as "at least 33", so 0.60.6

"At least 33" is the marked bars, X≥3X \ge 3, which add to 0.60.6; "fewer than 33" is the three bars before them, 0.40.4; "more than 33" drops the bar at 33 and leaves 0.30.3; and X>2.5X > 2.5 is the same event as "at least 33".

Expected value

E(X)=∑x P(X=x)\mathrm{E}(X) = \sum x\,\mathrm{P}(X = x)

Multiply each value by its probability, then add. This one is in the booklet (SL 4.7).

  • A long-run average. Repeat the experiment many times, and the mean of the results gets closer and closer to E(X)\mathrm{E}(X). It need not be a value XX can take: a fair six-sided die has E(X)=1+2+⋯+66=3.5\mathrm{E}(X) = \frac{1 + 2 + \cdots + 6}{6} = 3.5.
  • The same sum as the mean of a frequency table. xˉ=∑xf∑f=∑x⋅f∑f\bar{x} = \frac{\sum xf}{\sum f} = \sum x \cdot \frac{f}{\sum f}: the relative frequencies f∑f\frac{f}{\sum f} play the part of the probabilities (Averages and spread). That is why a question can call the mean of a survey an "expected" value.
  • Sense check. E(X)\mathrm{E}(X) lies between the smallest and the largest value of XX, pulled towards the values with large probabilities. Don't divide by the number of values: the probabilities already do the averaging.
  • A fair game. If XX is a player's gain (prize minus the cost to play), the game is fair when E(X)=0\mathrm{E}(X) = 0: in the long run the player neither wins nor loses. Equivalently, the expected prize equals the cost. E(X)<0\mathrm{E}(X) < 0 favours the organiser.
  • Totals over repeats. Over nn independent repeats, the expected total is n E(X)n\,\mathrm{E}(X). The expected number of occurrences, n×P(A)n \times \mathrm{P}(A), is the special case where XX is 11 when AA happens and 00 otherwise.
  • Technology. On P2 the GDC can do the arithmetic (one-variable statistics gives E(X)\mathrm{E}(X) from the values and their probabilities), but write the sum with its terms first: that line is the method mark.

Mini-example: a game costs $1\text{\textdollar}1 to play. The player wins $3\text{\textdollar}3 with probability 0.250.25, and nothing otherwise. The gain GG is 3−1=23 - 1 = 2 (probability 0.250.25) or −1-1 (probability 0.750.75):

E(G)=2(0.25)+(−1)(0.75)=0.5−0.75=−0.25\mathrm{E}(G) = 2(0.25) + (-1)(0.75) = 0.5 - 0.75 = -0.25

The player loses $0.25\text{\textdollar}0.25 a game on average, so over 100100 games the expected loss is $25\text{\textdollar}25. The game is not fair: the expected prize, 3(0.25)=$0.753(0.25) = \text{\textdollar}0.75, is less than the $1\text{\textdollar}1 cost. A prize of $m\text{\textdollar}m makes it fair when 0.25m=10.25m = 1, so a prize of $4\text{\textdollar}4.

Scope: the variance of XX, and the general rules E(aX+b)=a E(X)+b\mathrm{E}(aX + b) = a\,\mathrm{E}(X) + b and Var(aX+b)=a2 Var(X)\mathrm{Var}(aX + b) = a^2\,\mathrm{Var}(X), are AHL 4.14. At SL, work from the table of the variable you need (the gain rather than the prize, say), and write a new table when the prizes change. Two shortcuts are fine, and this guide uses them: a fixed cost comes straight off the expected prize (expected gain == expected prize −- cost, so a fair game has expected prize == cost, as SL markschemes use), and the other side of the same deal has the opposite expected value (the organiser's expected profit is the players' expected loss).

Table, experiment or context: which type?

  • a table or a formula for P(X=x)\mathrm{P}(X = x), with an unknown
    Asked for
    the unknown, a probability, E(X)\mathrm{E}(X)
    First move
    total =1= 1
  • a frequency table of data
    Asked for
    an "expected" value per person or item
    First move
    relative frequencies as probabilities
  • an experiment: dice, spins or a few rounds with a score, total or count; or draws, when the whole distribution is asked
    Asked for
    the distribution, or the probability of a value or range of the score
    First move
    list the outcomes that qualify
  • draws without replacement, or stages that change, with no distribution asked
    Asked for
    one probability
    First move
    a tree: multiply along, add across
  • a game with a cost and prizes, or sales with costs
    Asked for
    fair or not, an expected total, a least number or prize
    First move
    define the gain, then find its expected value
  • nn independent trials with the same probability, on P2
    Asked for
    the probability of a count
    First move
    X∼B(n,p)X \sim \mathrm{B}(n, p)
  • a table, and a condition on the range of XX
    Asked for
    a conditional probability
    First move
    the overlap of the two ranges
  • kk in Venn regions, tree branches or table cells for events
    Asked for
    kk
    First move
    an equation from the given fact

The gain is 22 with probability 0.250.25 and −1-1 with probability 0.750.75: the expected value, −0.25-0.25, is the balance point of the bars, pulled towards the taller one. It is not a value GG can take, and the game is not fair.


Where discrete random variables hide in other topics

A random variable often arrives inside a question that seems to belong to another topic, and other topics' methods turn up inside this guide's questions. The first move is to notice a list of values whose probabilities must add up to 11, or an average of an uncertain amount.

  • The probabilities P(X=1),…,P(X=4)\mathrm{P}(X = 1), \ldots, \mathrm{P}(X = 4) form a geometric sequence with common ratio 22 (Geometric sequences)
    It becomes
    Probability distribution tables: the sum of the four terms is 11, so u1(1+2+4+8)=1u_1(1 + 2 + 4 + 8) = 1 and u1=115u_1 = \frac{1}{15}
    Watch for
    every term must be between 00 and 11; then E(X)=1(1)+2(2)+3(4)+4(8)15=4915\mathrm{E}(X) = \frac{1(1) + 2(2) + 3(4) + 4(8)}{15} = \frac{49}{15}
  • A jackpot that grows each week it is not won, inside a game (Arithmetic sequences, or geometric)
    It becomes
    Expected value in context, with the week number ww as the unknown. A $600\text{\textdollar}600 jackpot rising by $600\text{\textdollar}600 a week is $600w\text{\textdollar}600w in week ww; won with probability 0.00050.0005, it is worth 0.0005×600w=0.3w0.0005 \times 600w = 0.3w on average. With other prizes worth $1.40\text{\textdollar}1.40 on average and a $3\text{\textdollar}3 ticket, the first week with a positive expected gain needs 1.4+0.3w>31.4 + 0.3w > 3
    Watch for
    a least ww, so round up and check both sides, as in Find n: w=5w = 5 gives an expected prize of $2.90\text{\textdollar}2.90 and w=6w = 6 gives $3.20\text{\textdollar}3.20, so week 66
  • A quadratic in kk from "total =1= 1" (Solving quadratic equations)
    Watch for
    reject any root that puts an entry outside [0,1][0, 1], even a positive one: the same check-the-context step as rejecting 2x=−12^x = -1 in Quadratic in disguise
  • On P1, an outcome that can happen in several orders (Factorials and nCr)
    It becomes
    Build the distribution from the experiment: one order's probability times the number of orders ((nr)\binom{n}{r} for rr of one result and n−rn - r of the other)
    Watch for
    22 wins in 44 rounds, each won with probability 12\frac{1}{2}: (42)(12)4=616=38\binom{4}{2}\left(\frac{1}{2}\right)^4 = \frac{6}{16} = \frac{3}{8}
  • The mean of a frequency table (Averages and spread)
    It becomes
    the same sum as E(X)\mathrm{E}(X), with the relative frequencies as probabilities (Probability distribution tables)
    Watch for
    a question may call the survey mean an "expected" number
  • A count of successes read from a tree, such as the number of red counters in two draws (Tree diagrams and repeated draws)
    It becomes
    Build the distribution from the experiment: collect the paths by the value of the count
    Watch for
    "one of each" has two paths
  • On P2, the number of successes in a fixed number of independent trials with the same probability
    It becomes
    Binomial probabilities, not a list of orders
    Watch for
    drawing without replacement breaks the binomial: that is a tree
  • A table of P(X=x)\mathrm{P}(X = x) with "given that"
    Watch for
    the numerator is the overlap of the two ranges, not the event alone
  • The fewest games so that the probability of at least one prize passes a target
    It becomes
    Find n: 1−qn>target1 - q^n > \text{target}, where qq is the probability of no prize in one game
    Watch for
    an expected total is n E(X)n\,\mathrm{E}(X); the probability of at least one prize is 1−qn1 - q^n

More in Statistics and probability

Every topic of the course

Guides