Scribe logoScribeNotes & practice
Sign inStart free
  1. Notes
  2. ›IB Mathematics: Analysis and Approaches
  3. ›4 Statistics and probability
  4. ›4.7 Discrete random variables

IB Mathematics: Analysis and Approaches · Topic 4 · Statistics and probability

4.7 Discrete random variables

Define a discrete random variable, build and check its probability distribution table, and calculate its expected value and variance.

  • 4 min read
  • 5 parts
  • 10 questions
  • Draft
Start a Quick 5 on this topic→Jump to the 10 questions
1/5A random variable turns outcomes into numbers
  1. 1A random variable turns outcomes into numbers
  2. 2A probability distribution lists every value with its probability
  3. 3The expected value is the long-run average
  4. 4Variance measures how far values spread around the mean
  5. 5Unknown probabilities and fair games use the same rules
  6. Check your recall
  7. Practice: 10 questions
1

Part 1 of 5: A random variable turns outcomes into numbers

Roll a fair die and record the score. Before the roll, you cannot say which number will appear. A random variable gives a numerical value to each outcome of a random process. We name it with a capital letter, such as XXX.

Counting heads in three coin tosses is another example. The possible values are 0, 1, 2 and 3. Because the values can be listed one by one, XXX is a discrete random variable.

Exact height is different, since it can take any value in an interval. That variable is not discrete. A small letter xxx stands for one particular value, and P(X=x)P(X=x)P(X=x) is the probability that XXX takes it.

Key terms · tap one for its definition

random variable

A random variable is a quantity XXX whose numerical value depends on the outcome of a random process.

discrete random variable

A discrete random variable is a random variable whose possible values can be listed individually, often as whole numbers.

Part 1 done

2

Part 2 of 5: A probability distribution lists every value with its probability

Now that XXX has possible values, each value needs a probability. Imagine a spinner with four sectors that score 1, 2, 3 or 4. The probability distribution of the score XXX lists every value with its probability.

Probability distribution of the spinner score X

xP(X = x)
10.1
20.3
30.4
40.2
x
1
P(X = x)
0.1
x
2
P(X = x)
0.3
x
3
P(X = x)
0.4
x
4
P(X = x)
0.2
Figure 1. The bar heights are the probabilities. The tallest bar marks the most likely score.

You can read probabilities directly from the table. For example, P(X=3)=0.4P(X=3)=0.4P(X=3)=0.4, so 3 is the most likely score. You can also add entries, so P(X≤2)=0.1+0.3=0.4P(X\le2)=0.1+0.3=0.4P(X≤2)=0.1+0.3=0.4.

Two rules must always hold for a distribution.

  • Every probability lies between 0 and 1.
  • The probabilities add up to 1, so ∑P(X=x)=1\sum P(X=x)=1∑P(X=x)=1.

Exam tip

Check that the probabilities sum to 1 before using a distribution. A total of 0.9 or 1.1 signals an error.

Key term

probability distribution

A probability distribution is the complete set of values of XXX together with their probabilities, which sum to 1.

Part 2 done

Quick check

One question on the part you just read

Easy

Identify the variable that is a discrete random variable.
Show answer and explanation

Answer: C · Worked explanation

The number of goals can be listed as 0, 1, 2 and so on, so it is discrete. Exact time, mass and temperature can take any value in an interval. Time is tempting because it is often rounded, but the underlying quantity is not a list of separate values.
3

Part 3 of 5: The expected value is the long-run average

Suppose you spin the spinner many times and average the scores. That average settles near a fixed number. This number is the expected value of XXX, written E(X)E(X)E(X).

To find it, multiply each value by its probability and add the results. So E(X)=∑xP(X=x)E(X)=\sum xP(X=x)E(X)=∑xP(X=x). It is a weighted mean, with the probabilities as weights.

Think of the weights as long-run fractions of the time. A score with probability 0.4 appears in about 40% of spins. So it contributes 40% of its value to the average.

Common mistake

The expected value need not be a possible value of XXX. A fair die has E(X)=3.5E(X)=3.5E(X)=3.5, yet you can never roll 3.5.

Worked example

Expected value of the spinner score

The spinner score XXX has P(X=1)=0.1P(X=1)=0.1P(X=1)=0.1, P(X=2)=0.3P(X=2)=0.3P(X=2)=0.3, P(X=3)=0.4P(X=3)=0.4P(X=3)=0.4 and P(X=4)=0.2P(X=4)=0.2P(X=4)=0.2. Calculate E(X)E(X)E(X).
  1. 1
    Use E(X)=∑xP(X=x)E(X)=\sum xP(X=x)E(X)=∑xP(X=x).
  2. 2
    Substitute: E(X)=1(0.1)+2(0.3)+3(0.4)+4(0.2)E(X)=1(0.1)+2(0.3)+3(0.4)+4(0.2)E(X)=1(0.1)+2(0.3)+3(0.4)+4(0.2).
  3. 3
    Evaluate: 0.1+0.6+1.2+0.8=2.70.1+0.6+1.2+0.8=2.70.1+0.6+1.2+0.8=2.7.

Answer: E(X)=2.7E(X)=2.7E(X)=2.7

Key term

expected value

The expected value of a discrete random variable XXX is E(X)=∑xP(X=x)E(X)=\sum xP(X=x)E(X)=∑xP(X=x), the long-run mean of its values.

Part 3 done

4

Part 4 of 5: Variance measures how far values spread around the mean

Two spinners can share the same expected value yet behave differently. One may give scores close together, and another may give scores far apart. The variance measures this spread.

Write μ=E(X)\mu=E(X)μ=E(X). Then Var(X)=E[(X−μ)2]\mathrm{Var}(X)=E\left[(X-\mu)^2\right]Var(X)=E[(X−μ)2], which is easier to compute as Var(X)=E(X2)−μ2\mathrm{Var}(X)=E(X^2)-\mu^2Var(X)=E(X2)−μ2. Here E(X2)=∑x2P(X=x)E(X^2)=\sum x^2P(X=x)E(X2)=∑x2P(X=x).

The standard deviation is the square root of the variance. It is in the same units as XXX.

A large variance means the values are widely spread. A variance of 0 means XXX always takes one value. Variance is never negative, because it averages squared distances.

Worked example

Variance of the spinner score

Using the spinner distribution above, with E(X)=2.7E(X)=2.7E(X)=2.7, calculate Var(X)\mathrm{Var}(X)Var(X) and the standard deviation.
  1. 1
    Find E(X2)=12(0.1)+22(0.3)+32(0.4)+42(0.2)E(X^2)=1^2(0.1)+2^2(0.3)+3^2(0.4)+4^2(0.2)E(X2)=12(0.1)+22(0.3)+32(0.4)+42(0.2).
  2. 2
    Evaluate: 0.1+1.2+3.6+3.2=8.10.1+1.2+3.6+3.2=8.10.1+1.2+3.6+3.2=8.1.
  3. 3
    Subtract μ2\mu^2μ2: Var(X)=8.1−2.72=8.1−7.29=0.81\mathrm{Var}(X)=8.1-2.7^2=8.1-7.29=0.81Var(X)=8.1−2.72=8.1−7.29=0.81.
  4. 4
    Take the square root: 0.81=0.9\sqrt{0.81}=0.90.81​=0.9.

Answer: Var(X)=0.81\mathrm{Var}(X)=0.81Var(X)=0.81 and the standard deviation is 0.9.

Common mistake

Do not square the probabilities. Square the values of XXX and keep each probability as it is.

Key terms · tap one for its definition

variance

The variance of XXX is Var(X)=E[(X−μ)2]\mathrm{Var}(X)=E\left[(X-\mu)^2\right]Var(X)=E[(X−μ)2], the expected squared distance from the mean μ\muμ.

standard deviation

The standard deviation of XXX is the square root of its variance and has the same units as XXX.

Part 4 done

Quick check

One question on the part you just read

Easy

A discrete random variable has probabilities 0.2, 0.3, kkk and 0.1 for its four values. Calculate kkk.
Show answer and explanation

Answer: A · Worked explanation

The probabilities must sum to 1, so k=1−(0.2+0.3+0.1)=1−0.6=0.4k=1-(0.2+0.3+0.1)=1-0.6=0.4k=1−(0.2+0.3+0.1)=1−0.6=0.4. The value 0.6 is the sum of the three known probabilities, not the missing one. Subtract that sum from 1 to find kkk. Always subtract the known probabilities from 1 rather than guessing a value, and check that the final list sums to exactly 1.
5

Part 5 of 5: Unknown probabilities and fair games use the same rules

Sometimes a distribution contains an unknown constant. Because the probabilities must sum to 1, you can form an equation and solve it.

Worked example

Finding an unknown constant

A discrete random variable has P(X=x)=kxP(X=x)=kxP(X=x)=kx for x=1,2,3,4x=1,2,3,4x=1,2,3,4. Find kkk and calculate E(X)E(X)E(X).
  1. 1
    The probabilities sum to 1: k+2k+3k+4k=1k+2k+3k+4k=1k+2k+3k+4k=1.
  2. 2
    So 10k=110k=110k=1 and k=0.1k=0.1k=0.1.
  3. 3
    Then E(X)=1(0.1)+2(0.2)+3(0.3)+4(0.4)E(X)=1(0.1)+2(0.2)+3(0.3)+4(0.4)E(X)=1(0.1)+2(0.2)+3(0.3)+4(0.4).
  4. 4
    Evaluate: 0.1+0.4+0.9+1.6=3.00.1+0.4+0.9+1.6=3.00.1+0.4+0.9+1.6=3.0.

Answer: k=0.1k=0.1k=0.1 and E(X)=3.0E(X)=3.0E(X)=3.0

Expected value can also judge a game of chance. The expected gain is the expected prize minus the cost to play. A fair game has an expected gain of 0. For example, a game costing £2 with an expected prize of £2 is fair.

Fairness describes the average over many plays, not the result of one play.

If the expected gain is negative, the player loses money on average over many plays. The organiser then expects a profit.

Go deeperChanging a variable by a linear rule

Suppose each score is doubled and then increased by 1, giving 2X+12X+12X+1. In general, for constants aaa and bbb, E(aX+b)=aE(X)+bE(aX+b)=aE(X)+bE(aX+b)=aE(X)+b and Var(aX+b)=a2Var(X)\mathrm{Var}(aX+b)=a^2\mathrm{Var}(X)Var(aX+b)=a2Var(X).

Adding bbb shifts every value but leaves the spread unchanged. Multiplying by aaa stretches the spread by aaa, so the variance changes by a2a^2a2.

Key term

fair game

A fair game is a game in which the expected gain for a player is zero.

Note read

Check your recall[14 marks]

6 written questions. Answer each one in your head or on paper, then open the mark scheme.

  1. 1.Define[2 marks]

    Define a discrete random variable.

    Show mark schemeHide mark scheme

    Model answer

    A discrete random variable is a variable whose numerical value depends on the outcome of a random process. Its possible values can be listed individually.

    • 1 mark for stating that its value depends on the outcome of a random process
    • 1 mark for stating that its possible values can be listed individually
  2. 2.Explain[2 marks]

    Explain why the probabilities 0.5, 0.4 and 0.3 cannot form a probability distribution for X=1,2,3X=1,2,3X=1,2,3.

    Show mark schemeHide mark scheme

    Model answer

    The probabilities of a distribution must sum to 1. Here 0.5+0.4+0.3=1.20.5+0.4+0.3=1.20.5+0.4+0.3=1.2, which is greater than 1.

    • 1 mark for stating that the probabilities must sum to 1
    • 1 mark for showing that the given probabilities sum to 1.2
  3. 3.Calculate[2 marks]

    The variable XXX has P(X=0)=0.2P(X=0)=0.2P(X=0)=0.2, P(X=1)=0.5P(X=1)=0.5P(X=1)=0.5, P(X=2)=0.2P(X=2)=0.2P(X=2)=0.2 and P(X=3)=0.1P(X=3)=0.1P(X=3)=0.1. Calculate E(X)E(X)E(X).

    Show mark schemeHide mark scheme

    Model answer

    E(X)=0(0.2)+1(0.5)+2(0.2)+3(0.1)=0+0.5+0.4+0.3=1.2E(X)=0(0.2)+1(0.5)+2(0.2)+3(0.1)=0+0.5+0.4+0.3=1.2E(X)=0(0.2)+1(0.5)+2(0.2)+3(0.1)=0+0.5+0.4+0.3=1.2.

    • 1 mark for multiplying each value by its probability and adding
    • 1 mark for obtaining E(X)=1.2E(X)=1.2E(X)=1.2
  4. 4.Calculate[3 marks]

    For the same variable, calculate Var(X)\mathrm{Var}(X)Var(X).

    Show mark schemeHide mark scheme

    Model answer

    E(X2)=0+1(0.5)+4(0.2)+9(0.1)=2.2E(X^2)=0+1(0.5)+4(0.2)+9(0.1)=2.2E(X2)=0+1(0.5)+4(0.2)+9(0.1)=2.2. So Var(X)=2.2−1.22=2.2−1.44=0.76\mathrm{Var}(X)=2.2-1.2^2=2.2-1.44=0.76Var(X)=2.2−1.22=2.2−1.44=0.76.

    • 1 mark for finding E(X2)=2.2E(X^2)=2.2E(X2)=2.2
    • 1 mark for subtracting μ2=1.44\mu^2=1.44μ2=1.44
    • 1 mark for obtaining Var(X)=0.76\mathrm{Var}(X)=0.76Var(X)=0.76
  5. 5.Determine[2 marks]

    A variable has P(X=1)=0.1P(X=1)=0.1P(X=1)=0.1, P(X=2)=kP(X=2)=kP(X=2)=k, P(X=3)=2kP(X=3)=2kP(X=3)=2k and P(X=4)=0.3P(X=4)=0.3P(X=4)=0.3. Determine kkk.

    Show mark schemeHide mark scheme

    Model answer

    The probabilities sum to 1, so 0.1+k+2k+0.3=10.1+k+2k+0.3=10.1+k+2k+0.3=1. Then 3k=0.63k=0.63k=0.6 and k=0.2k=0.2k=0.2.

    • 1 mark for forming the equation 0.1+k+2k+0.3=10.1+k+2k+0.3=10.1+k+2k+0.3=1
    • 1 mark for solving to obtain k=0.2k=0.2k=0.2
  6. 6.Determine[3 marks]

    A game costs £3 to play. The expected prize is £2.40. Determine the expected gain and state whether the game is fair.

    Show mark schemeHide mark scheme

    Model answer

    Expected gain =2.40−3=−0.60=2.40-3=-0.60=2.40−3=−0.60, so the expected gain is −-−£0.60. This is not zero, so the game is not fair.

    • 1 mark for subtracting the cost from the expected prize
    • 1 mark for obtaining an expected gain of −-−£0.60
    • 1 mark for stating that the game is not fair because the expected gain is not zero

Practice this topic

10 quick-fire multiple-choice questions, easy to hard. Tap an answer to see if you're right and the worked explanation. (The written questions with mark schemes are under “Check your recall” above.)

0 right0 of 10 answered

Includes the 2 quick checks in the note above.

3.

Easy·Identify[1 mark]

Identify the formula for the expected value of a discrete random variable XXX.
Show answer and explanation

Answer: B · Worked explanation

Each value is multiplied by its probability and the products are added. The sum of probabilities is always 1, so it cannot be the mean. The expression with x2x^2x2 is E(X2)E(X^2)E(X2), which is used when finding variance, not the expected value itself.
4.

Medium·Calculate[2 marks]

A variable takes the values 2, 4, 6 and 8 with probabilities 0.1, 0.4, 0.3 and 0.2. Calculate E(X)E(X)E(X).
Show answer and explanation

Answer: D · Worked explanation

Compute 2(0.1)+4(0.4)+6(0.3)+8(0.2)=0.2+1.6+1.8+1.6=5.22(0.1)+4(0.4)+6(0.3)+8(0.2)=0.2+1.6+1.8+1.6=5.22(0.1)+4(0.4)+6(0.3)+8(0.2)=0.2+1.6+1.8+1.6=5.2. The value 5.0 comes from averaging 2, 4, 6 and 8 without weighting. That ignores that some values are more likely than others. Weighting matters because a value with probability 0.4 should count for more than a value with probability 0.1. Checking that the probabilities sum to 1 first confirms the table is valid.
5.

Medium·Calculate[2 marks]

A variable has E(X)=3E(X)=3E(X)=3 and E(X2)=11E(X^2)=11E(X2)=11. Calculate Var(X)\mathrm{Var}(X)Var(X).
Show answer and explanation

Answer: A · Worked explanation

Use Var(X)=E(X2)−[E(X)]2=11−32=11−9=2\mathrm{Var}(X)=E(X^2)-[E(X)]^2=11-3^2=11-9=2Var(X)=E(X2)−[E(X)]2=11−32=11−9=2. The value 8 comes from subtracting E(X)E(X)E(X) instead of its square. The mean must be squared before it is subtracted. It helps to remember that the mean is squared inside the formula. Writing the two terms separately before subtracting, here 11 and 9, makes this slip easy to avoid.
6.

Medium·Determine[2 marks]

A variable has P(X=x)=k(5−x)P(X=x)=k(5-x)P(X=x)=k(5−x) for x=1,2,3x=1,2,3x=1,2,3. Determine P(X=1)P(X=1)P(X=1).
Show answer and explanation

Answer: C · Worked explanation

The probabilities are 4k4k4k, 3k3k3k and 2k2k2k, which sum to 9k=19k=19k=1, so k=19k=\frac{1}{9}k=91​. Then P(X=1)=4k=49P(X=1)=4k=\frac{4}{9}P(X=1)=4k=94​. The value 19\frac{1}{9}91​ is only kkk, not the probability itself. The probabilities must be positive and sum to 1, which fixes kkk. Check by confirming that 49+39+29=1\frac{4}{9}+\frac{3}{9}+\frac{2}{9}=194​+93​+92​=1.
7.

Medium·Calculate[2 marks]

A game costs £4 to play. The prize is £0 with probability 0.5, £5 with probability 0.3 and £10 with probability 0.2. Calculate the expected gain.
Show answer and explanation

Answer: B · Worked explanation

The expected prize is 0(0.5)+5(0.3)+10(0.2)=3.500(0.5)+5(0.3)+10(0.2)=3.500(0.5)+5(0.3)+10(0.2)=3.50. Subtract the £4 cost to get an expected gain of −-−£0.50. The value £3.50 is the expected prize, not the gain after paying to play. A negative expected gain means that, over many plays, the organiser is expected to profit. This does not stop a single player from winning on one play.
8.

Hard·Determine[2 marks]

A variable takes values 0, 1 and 2. It has P(X=0)=0.2P(X=0)=0.2P(X=0)=0.2 and E(X)=1.1E(X)=1.1E(X)=1.1. Determine Var(X)\mathrm{Var}(X)Var(X).
Show answer and explanation

Answer: A · Worked explanation

Let P(X=1)=aP(X=1)=aP(X=1)=a and P(X=2)=bP(X=2)=bP(X=2)=b. Then a+b=0.8a+b=0.8a+b=0.8 and a+2b=1.1a+2b=1.1a+2b=1.1, so b=0.3b=0.3b=0.3 and a=0.5a=0.5a=0.5. Now E(X2)=0.5+4(0.3)=1.7E(X^2)=0.5+4(0.3)=1.7E(X2)=0.5+4(0.3)=1.7, and Var(X)=1.7−1.21=0.49\mathrm{Var}(X)=1.7-1.21=0.49Var(X)=1.7−1.21=0.49. The value 1.7 is E(X2)E(X^2)E(X2), and 0.70 is the standard deviation. Always solve for the missing probabilities first, because the variance needs the whole distribution. The sum rule and the given mean supply two equations for two unknowns.
9.

Hard·Identify[2 marks]

Identify the list that could give the probabilities of X=1,2,3,4X=1,2,3,4X=1,2,3,4.
Show answer and explanation

Answer: D · Worked explanation

The list 0.25, 0.35, 0.30, 0.10 sums to 1.00 and every entry lies between 0 and 1. The list containing $-$0.10 also sums to 1, but a probability cannot be negative. The lists 0.30, 0.30, 0.30, 0.20 and 0.20, 0.20, 0.20, 0.20 sum to 1.1 and 0.8, so they fail the sum rule.
10.

Hard·Determine[2 marks]

A variable has P(X=x)=k(x+1)P(X=x)=k(x+1)P(X=x)=k(x+1) for x=0,1,2,3x=0,1,2,3x=0,1,2,3. Determine Var(X)\mathrm{Var}(X)Var(X).
Show answer and explanation

Answer: C · Worked explanation

The sum k(1+2+3+4)=1k(1+2+3+4)=1k(1+2+3+4)=1 gives k=0.1k=0.1k=0.1. Then E(X)=0.2+0.6+1.2=2.0E(X)=0.2+0.6+1.2=2.0E(X)=0.2+0.6+1.2=2.0 and E(X2)=0.2+1.2+3.6=5.0E(X^2)=0.2+1.2+3.6=5.0E(X2)=0.2+1.2+3.6=5.0, so Var(X)=5.0−4.0=1.0\mathrm{Var}(X)=5.0-4.0=1.0Var(X)=5.0−4.0=1.0. The value 5.0 is E(X2)E(X^2)E(X2) alone, and 1.5 comes from averaging squared distances without weights. Check the value of kkk first, since every later step depends on it. A quick test is that the four probabilities 0.1, 0.2, 0.3 and 0.4 sum to 1.

Keep going

Next topic4.8 Binomial distributionPrevious topic4.6 Combined events and diagrams

More in Topic 4 · Statistics and probability

  1. 4.3Measures of central tendency and spreadNotes · 10 questions
  2. 4.4Correlation and regressionNotes · 10 questions
  3. 4.5Probability conceptsNotes · 10 questions
  4. 4.6Combined events and diagramsNotes · 10 questions
  5. 4.7Discrete random variablesNotes · 10 questions
  6. 4.8Binomial distributionNotes · 10 questions
  7. 4.9Normal distributionNotes · 10 questions
  8. 4.10Regression of x on yNotes · 10 questions
  9. 4.11Conditional probability and independenceNotes · 10 questions

All IB Mathematics: Analysis and Approaches topics →

Draft: written by Scribe and checked automatically, not yet by a subject reviewer.

Practice questions are original, written by Scribe and checked automatically for correctness.

Topic codes follow the official numbering. Not endorsed by IB Diploma Programme or any exam board.

On this page

0/5 read

  1. 1A random variable turns outcomes into numbers
  2. 2A probability distribution lists every value with its probability
  3. 3The expected value is the long-run average
  4. 4Variance measures how far values spread around the mean
  5. 5Unknown probabilities and fair games use the same rules
  6. Check your recall
  7. Practice: 10 questions
All coursesScribeHow it worksPricingPrivacyTerms

Notes and questions are written by Scribe in our own words. Topic codes follow the official course numbering so you can find your place. Not produced or endorsed by the IB, College Board, AQA, OCR, Pearson Edexcel or any exam board.

© 2026 Scribe