Skip to content
IB Diploma ProgrammeSL & HL

Discrete random variables

Mathematics: Analysis and Approaches SL & HL Chapter Notes

Last updated November 2026

ShareWhatsAppPost

Discrete random variables notes as a printable PDF.

Read online free. Download a watermarked copy with a free account.

Read the notes

The full Discrete random variables notes as text: skim, search, and jump between subtopics.

~16 min read

1. Discrete random variables and probability distributions

A discrete random variable X takes separate values, such as 1, 2, 3, 4, 5. Its probability distribution gives P(X =x) for every value x.

A distribution can be given as a table of x against P(X = x), or as a formula for P(X =x) over a set of values. Every probability is between 0 and 1, and the probabilities sum to 1.

When a value in a table is unknown, use that sum to find it. Write the equation, then solve. The command term *find* needs the working, not just the answer.

sum P(X = x) = 1

0 ≤ P(X = x) ≤ 1

Worked example 14 marks

The following table shows the probability distribution of a discrete random variable X, for 1 ≤ X ≤ 6, such that P(X = 1) = k and P(X = r + 1) = 1/2P(X = r), where r ∈ Z⁺, 1 ≤ r ≤ 5 and k ∈ R.

(a) Write down an expression in terms of k for(i) a;(ii) b.

(b) Find the value of k.

x123456
P(X = x)ka8/63k/8b1/63
  1. 1

    (a)(i) each probability is half the one before: a = k/2 (A1) [1]

  2. 2

    (ii) b = k/16 (A1) [1]

  3. 3

    (b) summing probabilities to 1: k + k/2 + 8/63 + k/8 + k/16 + 1/63 = 1 (M1) [1]

  4. 4

    27k/16 = 6/7, so k = 32/63 (= 0.507936…) (A1) [1]

2. A distribution given by a formula

A distribution may be given as a formula, such as P(X =x) = 1/18(4 +x) for x ∈ {1, 2, 3}. Substitute each value of x in turn to build the table.

Then check that the probabilities sum to 1. A *show that* question needs every probability written out and the sum reached, because the answer is given.

To find the probability of a range such as X ≥ 2, add the probabilities of the values in the range.

P(X = x) = 1/18(4 + x), x ∈ {1, 2, 3}

P(X ≥ 2) = P(X = 2) + P(X = 3)

Worked example 14 marks

The discrete random variable X has probability distribution P(X =x) = 1/18(4 +x) for x ∈ {1, 2, 3}.

(a) Show that this is a probability distribution.

(b) Find P(X ≥ 2).

  1. 1

    (a) substitute each value: P(X = 1) = 5/18, P(X = 2) = 6/18, P(X = 3) = 7/18 (M1) [1]

  2. 2

    the probabilities sum to 1: (5 + 6 + 7)/18 = 18/18 = 1 (A1)(AG) [1]

  3. 3

    (b) add the probabilities for x = 2 and x = 3 (M1) [1]

  4. 4

    P(X ≥ 2) = 6/18 + 7/18 = 13/18 (A1) [1]

3. Expected value

The expected value (mean) of a discrete random variable is the sum of each value multiplied by its probability.

It need not be a value that X can take. Do not divide by the number of values: the probabilities already do the weighting.

Write the sum out with each term, so the method mark is clear. Give an exact value or three significant figures.

E(X) = sum x P(X = x)

Worked example 12 marks

Two unbiased tetrahedral (four-sided) dice with faces labelled 1, 2, 3 and 4 are thrown and the scores recorded. The random variable M denotes the maximum of these two scores. The probability distribution of M is given in the following table.

Find E(M).

m1234
P(M = m)1/163/165/167/16
  1. 1

    attempts to use E(M) = sum m P(M = m): 1 × 1/16 + 2 × 3/16 + 3 × 5/16 + 4 × 7/16 (M1) [1]

  2. 2

    = 50/16 = 25/8 = 3.125 (A1) [1]

4. Applications: the expected total over many trials

E(X) is the expected value for one trial. If the trial is repeated n times, the expected total is n times E(X).

The command term *estimate* accepts this value. Keep E(X) as a fraction or unrounded decimal until the last line, because rounding first changes the total.

expected total = n × E(X)

Worked example 16 marks

Lynn is playing a game with two unbiased six-sided dice, each with faces marked with the integers from 1 to 6. In each round, she throws both dice once. Lynn scores points according to the following rules. If the two dice show the same score, she scores 10 points. If the two dice show scores which have a difference of one, for example the scores 4 and 5 in any order, she scores 5 points. Otherwise, she scores 0 points. The random variable X represents the number of points Lynn scores in one round. Its probability distribution is given in the following table.

(c) Find E(X).

(d) Hence, estimate the total number of points that Lynn scores if she plays 90 rounds.

x0510
P(X = x)20/3610/366/36
  1. 1

    (c) P(X = 10) = 6/36 = 1/6 (may be seen in a table) (A1) [1]

  2. 2

    attempt to use formula for expected value (M1) [1]

  3. 3

    E(X) = 0 × 20/36 + 5 × 10/36 + 10 × 6/36 (A1) [1]

  4. 4

    = 110/36 = 55/18 = 3.06 (A1) [1]

  5. 5

    (d) recognition that E(X) must be multiplied by 90 (M1) [1]

  6. 6

    110/36 × 90 = 275 (A1) [1]

5. Fair games

In a game, let X be the gain of a player. The gain is the winnings minus the stake the player pays to play.

The syllabus states that E(X) = 0 indicates a fair game.

To find an unknown prize or stake, write E(X) in terms of the unknown and set it equal to 0.

E(X) = 0 ⇒ fair game

gain = winnings - stake

Worked example 14 marks

A player pays 3 dollars to play a game. A fair six-sided die is rolled once. If the score is 6, the player receives p dollars. Otherwise the player receives nothing. The gain of the player is X dollars. Given that the game is fair, find the value of p.

  1. 1

    gain is winnings minus stake: X = p - 3 with probability 1/6, and X = -3 with probability 5/6 (A1) [1]

  2. 2

    fair game, so E(X) = 0 (M1) [1]

  3. 3

    (p - 3) × 1/6 + (-3) × 5/6 = 0, so p - 3 = 15 (A1) [1]

  4. 4

    p = 18 (A1) [1]

6. Finding unknown probabilities from E(X)

A table may hold two unknown probabilities, with E(X) given. Each fact gives one equation.

The probabilities sum to 1: that is the first equation. The given E(X) is the second. Solve the two together.

Check by substituting back into E(X). A probability outside 0 to 1 means an error.

sum P(X = x) = 1

sum x P(X = x) = E(X)

Worked example 15 marks

The discrete random variable X has the probability distribution in the following table. Given that E(X) = 1.7, find the value of a and the value of b.

x0123
P(X = x)0.1ab0.2
  1. 1

    sum of probabilities is 1: 0.1 + a + b + 0.2 = 1 (M1) [1]

  2. 2

    a + b = 0.7 (A1) [1]

  3. 3

    use the given E(X): 0 × 0.1 + 1 × a + 2 × b + 3 × 0.2 = 1.7 (M1) [1]

  4. 4

    a + 2b = 1.1 (A1) [1]

  5. 5

    subtract: b = 0.4, so a = 0.3 (A1) [1]

Recap

  • A discrete random variable has a probability distribution: P(X = x) for each value, as a table or a formula.
  • Every probability is between 0 and 1 and the probabilities sum to 1. Use this to find an unknown value.
  • E(X) = sum x P(X = x). Write each term. It need not be a value X can take.
  • Expected total over n trials is n E(X). Do not round E(X) first.
  • In a game, X is the gain, winnings minus stake. E(X) = 0 indicates a fair game.
  • Show the working. A correct answer with no method may earn no marks.

End-of-chapter exercise

Test yourself on the whole chapter. Work through these before moving on.

  1. Do not use a calculator. The following table is proposed as the probability distribution of a discrete random variable X. Determine whether it is a valid probability distribution. | x | 1 | 2 | 3 | 4 | | --- | --- | --- | --- | --- | | P(X = x) | 0.3 | 0.2 | 0.4 | 0.2 |2 marks
    Answer
    1. 0.3 + 0.2 + 0.4 + 0.2 = 1.1 (M1)
    2. The probabilities do not sum to 1, so it is not valid (R1).

    Trap: Each probability is below 1, but that is not enough. The sum must be 1.

  2. Do not use a calculator. The discrete random variable X has P(X = x) = kx for x ∈ {1, 2, 3, 4}. Find the value of k and hence find P(X ≥ 3).3 marks
    Answer
    1. k + 2k + 3k + 4k = 1, so 10k = 1 and k = 1/10 (M1)(A1)
    2. P(X ≥ 3) = 3/10 + 4/10 = 7/10 (A1)

    Trap: X ≥ 3 includes both 3 and 4. Leaving out P(X = 3) gives 4/10.

  3. Do not use a calculator. The discrete random variable X has the following probability distribution. Find E(X). | x | 0 | 1 | 2 | 3 | | --- | --- | --- | --- | --- | | P(X = x) | 0.1 | 0.3 | 0.4 | 0.2 |2 marks
    Answer
    1. E(X) = 0 × 0.1 + 1 × 0.3 + 2 × 0.4 + 3 × 0.2 (M1)
    2. = 0.3 + 0.8 + 0.6 = 1.7 (A1)

    Trap: (0 + 1 + 2 + 3)/4 = 1.5 ignores the probabilities.

  4. Do not use a calculator. The discrete random variable X has P(X = x) = x²/14 for x ∈ {1, 2, 3}. (a) Show that this is a probability distribution. (b) Find E(X).4 marks
    Answer
    1. (a)
    2. P(X = 1) = 1/14, P(X = 2) = 4/14, P(X = 3) = 9/14 (M1)
    3. (1 + 4 + 9)/14 = 14/14 = 1 (A1)(AG)
    4. (b)
    5. E(X) = 1 × 1/14 + 2 × 4/14 + 3 × 9/14 (M1)
    6. = (1 + 8 + 27)/14 = 36/14 = 18/7 (A1)

    Trap: E(X) multiplies x by P(X = x). Using x²/14 alone as the term gives 14/14 = 1.

  5. The random variable X is the number of goals a team scores in a match. Its probability distribution is in the following table. (a) Calculate E(X). (b) Hence estimate the total number of goals the team scores in 38 matches. | x | 0 | 1 | 2 | 3 | | --- | --- | --- | --- | --- | | P(X = x) | 0.2 | 0.35 | 0.3 | 0.15 |4 marks
    Answer
    1. (a)
    2. E(X) = 0 + 1 × 0.35 + 2 × 0.3 + 3 × 0.15 (M1)
    3. = 0.35 + 0.6 + 0.45 = 1.4 (A1)
    4. (b)
    5. 38 × 1.4 (M1)
    6. = 53.2, so about 53 goals (A1)

    Trap: Multiplying 38 by the most likely value, 1 goal, gives 38. The estimate uses E(X), not the most likely value.

  6. Do not use a calculator. A player pays 5 dollars to play a game. A fair coin is tossed twice. The player receives 8 dollars for two heads, 2 dollars for exactly one head and nothing for no heads. The gain of the player is X dollars. Determine whether the game is fair.4 marks
    Answer
    1. gain = winnings - stake: X = 3 with probability 1/4, X = -3 with probability 1/2, X = -5 with probability 1/4 (A1)
    2. E(X) = 3 × 1/4 + (-3) × 1/2 + (-5) × 1/4 (M1)
    3. = 3/4 - 3/2 - 5/4 = -2 (A1)
    4. E(X) ≠ 0, so the game is not fair (R1).

    Trap: The winnings alone have expected value 3 dollars. The stake of 5 dollars must be taken off to get the gain.

  7. Do not use a calculator. A bag holds 3 red counters and 2 blue counters. A player pays 4 dollars to play. One counter is drawn at random. A red counter wins 2 dollars and a blue counter wins p dollars. The gain of the player is X dollars. Given that the game is fair, determine the value of p.4 marks
    Answer
    1. X = -2 with probability 3/5 and X = p - 4 with probability 2/5 (A1)
    2. fair game, so E(X) = 0 (M1)
    3. -2 × 3/5 + (p - 4) × 2/5 = 0, so 2(p - 4) = 6 (A1)
    4. p = 7 (A1)

    Trap: Using the prize p as X instead of the gain p - 4 forgets the stake.

  8. The discrete random variable X has the following probability distribution. Given that E(X) = 2.7, find the value of a and the value of b. | x | 1 | 2 | 3 | 4 | | --- | --- | --- | --- | --- | | P(X = x) | 0.1 | a | b | 0.3 |5 marks
    Answer
    1. 0.1 + a + b + 0.3 = 1, so a + b = 0.6 (M1)(A1)
    2. 1 × 0.1 + 2a + 3b + 4 × 0.3 = 2.7, so 2a + 3b = 1.4 (M1)(A1)
    3. 2(0.6 - b) + 3b = 1.4, so b = 0.2 and a = 0.4 (A1)
    4. Check: 0.1 + 0.8 + 0.6 + 1.2 = 2.7.

    Trap: Two unknowns need two equations. Using only E(X) = 2.7 leaves a and b undetermined.

  9. Do not use a calculator. A fair spinner has four equal sectors numbered 1, 2, 3 and 4. It is spun twice. A player pays 1.50 dollars to play and receives, in dollars, the difference between the two scores (the larger minus the smaller, or 0 if they are equal). The gain of the player is X dollars. Determine whether the game is fair.5 marks
    Answer
    1. There are 4 × 4 = 16 equally likely outcomes. A difference of 0 occurs in 4, of 1 in 6, of 2 in 4 and of 3 in 2 (M1).
    2. gain = winnings - stake: X = -1.5, -0.5, 0.5, 1.5 with probabilities 4/16, 6/16, 4/16, 2/16 (A1)
    3. E(X) = -1.5 × 4/16 + (-0.5) × 6/16 + 0.5 × 4/16 + 1.5 × 2/16 (M1)
    4. = (-6 - 3 + 2 + 3)/16 = -1/4 (A1)
    5. E(X) ≠ 0, so the game is not fair (R1).

    Trap: Treating the differences 0, 1, 2, 3 as equally likely gives expected winnings of 1.50 dollars, equal to the stake, and the wrong verdict that the game is fair.

  10. At a charity fair, a biased spinner shows a score S from 1 to 4, with P(S = s) = (s + k)/30 for s ∈ {1, 2, 3, 4}. A player pays 4 dollars to spin once. A score of 4 wins w dollars, a score of 3 wins 5 dollars, and a score of 1 or 2 wins nothing. The gain of the player is X dollars. (a) Find the value of k. (b) Determine the value of w, to the nearest cent, for which the game is fair. The organiser sets w = 8 and the game is played 600 times. (c) Estimate the organiser's total profit.9 marks
    Answer
    1. (a)
    2. ((1 + k) + (2 + k) + (3 + k) + (4 + k))/30 = 1, so 10 + 4k = 30 (M1)
    3. k = 5, so the probabilities are 6/30, 7/30, 8/30, 9/30 (A1)
    4. (b)
    5. gain = winnings - stake: X = -4 with probability 13/30, X = 1 with probability 8/30, X = w - 4 with probability 9/30 (A1)
    6. fair game, so E(X) = 0: -4 × 13/30 + 1 × 8/30 + (w - 4) × 9/30 = 0 (M1)
    7. 9(w - 4) = 44 (A1)
    8. w = 80/9 = 8.89 dollars (A1)
    9. (c)
    10. with w = 8: E(X) = -4 × 13/30 + 1 × 8/30 + 4 × 9/30 (M1)
    11. = (-52 + 8 + 36)/30 = -4/15 (A1)
    12. the organiser gains 4/15 dollars per play: 600 × 4/15 = 160 dollars (A1)

    Trap: Taking the gain on a score of 4 as w instead of w - 4 forgets that a winner has also paid the stake, and gives w = 44/9 = 4.89.

Say this, not that

Wording that loses the mark, against the wording the mark scheme credits.

Loses the markGets the mark
E(X) = (1 + 2 + 3 + 4)/4, the mean of the values of xE(X) = sum x P(X = x): attempt to use formula for expected value
the probabilities 0.3, 0.2, 0.4, 0.2 are a distribution because each is below 1summing probabilities to 1: 0.3 + 0.2 + 0.4 + 0.2 = 1.1, so it is not a distribution
E(X) ≈ 3, so 3 × 90 = 270 pointsrecognition that E(X) must be multiplied by 90: 110/36 × 90 = 275
E(X) = -2, so the game is fairE(X) = 0 indicates a fair game; here E(X) = -2 ≠ 0, so the game is not fair

Frequently asked questions

How do you check whether a table is a valid probability distribution?
Check two things: every probability is between 0 and 1, and the probabilities sum to 1. Each probability being below 1 is not enough. For the table 0.3, 0.2, 0.4, 0.2, each value is below 1, but 0.3 + 0.2 + 0.4 + 0.2 = 1.1, so it is not a valid distribution.
How do you find unknown probabilities in a distribution table?
Write one equation from the sum of the probabilities being 1, and a second from the given E(X), then solve them together. For x = 0, 1, 2, 3 with probabilities 0.1, a, b, 0.2 and E(X) = 1.7, the equations a + b = 0.7 and a + 2b = 1.1 give b = 0.4 and a = 0.3. Check by substituting back into E(X), and a probability outside 0 to 1 means an error.
How do you calculate the expected value E(X) of a discrete random variable?
Multiply each value by its probability and add: E(X) = sum x P(X = x). Write out each term. For 0 × 0.1 + 1 × 0.3 + 2 × 0.4 + 3 × 0.2, the expected value is 1.7. It need not be a value that X can take, and you do not divide by the number of values.
How do you estimate the total over many trials using the expected value?
The expected total over n trials is n × E(X), because E(X) is the expected value for one trial. For a team scoring E(X) = 1.4 goals a match, over 38 matches the estimate is 38 × 1.4 = 53.2, so about 53 goals. Keep E(X) unrounded until the last line.
How do you decide whether a game is fair?
In a game, X is the gain: the winnings minus the stake the player pays. The game is fair when E(X) = 0. To find an unknown prize p, write E(X) in terms of p and set it equal to 0. For a stake of 3 dollars and a 1 in 6 chance of winning p dollars, (p - 3) × 1/6 + (-3) × 5/6 = 0 gives p = 18.
Why do I use the gain, not the winnings, when I check whether a game is fair?
The gain is the winnings minus the stake, so X = p - 4 and not p when a player pays 4 dollars and wins p dollars. Using the prize as X forgets the stake and gives the wrong answer. For example, a player paying 5 dollars who gets 8 dollars for two heads has expected gain -2 dollars, so the game is not fair.

Free notes are just the start.

Unlock every Workbook and Chapter at a Glance, and generate your own worksheets and predicted papers.

Explore plans

Related chapters