Discrete random variables and the binomial distribution AA SL

A discrete random variable lists the values an outcome can take and the probability of each, and the binomial distribution is the special case that counts successes in a fixed number of independent trials. This page shows how to complete a probability table, find an expected value and decide whether a game is fair, then how to recognise a binomial situation, find its probabilities with the calculator and use its mean and variance, with worked examples and exam-style questions.

Formulas at a glance

The expected value formula, and the mean and variance of a binomial distribution, are in the formula booklet. The rule that the probabilities add up to 1 and the four conditions for a binomial model are not, so learn them. Binomial probabilities are found with the calculator, so there is no probability formula to memorise.

Expected value of a discrete random variable

E(X)=∑xP(X=x)E(X)=\sum xP(X=x)

In the booklet

Binomial distribution and its mean

X∼B(n,p)X\sim B(n,p), E(X)=npE(X)=np

In the booklet

Which method to use

Decide first whether you have a probability table or a binomial situation, then choose the calculation from what the question asks for.

The question asks forUseNotes
An unknown probability kk in a tableThe probabilities add up to 1Write the equation, solve it, then check that every probability is between 0 and 1
The expected value of a discrete variableE(X)=∑xP(X=x)E(X)=\sum xP(X=x)Multiply each value by its own probability, then add. The result need not be a value that XX can take
Whether a game is fairCheck whether E(X)=0E(X)=0, where XX is the gain of the playerPut the cost of playing inside the values of XX, as a negative gain
Whether a situation is binomialA fixed number of trials, two outcomes, constant probability, independent trialsAll four must hold. Then write X∼B(n,p)X\sim B(n,p) and say what counts as a success
P(X=k)P(X=k)Binomial probability (exactly kk) on the calculatorEnter the number of trials, then the probability, then kk
P(X≤k)P(X\le k) or P(X<k)P(X<k)Binomial cumulative probability, with kk or k−1k-1The cumulative function includes the value you enter, so P(X<k)=P(X≤k−1)P(X<k)=P(X\le k-1)
P(X≥k)P(X\ge k) or P(X>k)P(X>k)1−P(X≤k−1)1-P(X\le k-1) or 1−P(X≤k)1-P(X\le k)"At least one" is 1−P(X=0)1-P(X=0). The most common slip is using kk instead of k−1k-1
P(a≤X≤b)P(a\le X\le b)P(X≤b)−P(X≤a−1)P(X\le b)-P(X\le a-1)Subtract the cumulative probability just below aa
The mean and variance of a binomial variablenpnp and np(1−p)np(1-p)Both are in the formula booklet. The standard deviation is the square root of the variance
An unknown nn or pp given the mean and varianceDivide the variance by the mean to get 1−p1-p, then find nn from npnpCheck that nn is a whole number and pp is between 0 and 1

Section 1 of 2 SL4.7

Discrete random variables and expected value

A discrete random variable XX takes separate values, each with a probability, and the probabilities in its distribution add up to 11. The expected value E(X)=∑xP(X=x)E(X)=\sum xP(X=x) is the long-run mean, found by multiplying each value by its probability and adding the results. Use the table to find missing probabilities and to decide whether a game is fair.

The key formula

Valid distributions

∑P(X=x)=1\sum P(X=x) = 1

Every entry in a probability table must lie between 0 and 1, and the whole row must sum to exactly 1 - this is often how you find an unknown kk.

Key terms

What is a random variable?

A random variable is a quantity whose value depends on the outcome of a random process, written with a capital letter such as XX. A particular value it can take is written with a lower case letter such as xx.

e.g. If XX is the score on one roll of a fair die, then XX can take the values 11 to 66 and P(X=4)=16P(X=4)=\dfrac16.

What is a probability distribution?

A probability distribution lists every value xx that XX can take with its probability P(X=x)P(X=x), usually in a table. The probabilities must add up to 11.

e.g. If P(X=1)=0.3P(X=1)=0.3, P(X=2)=0.5P(X=2)=0.5 and P(X=3)=kP(X=3)=k, then 0.3+0.5+k=10.3+0.5+k=1, so k=0.2k=0.2.

What does expected value represent?

The expected value is the mean of the distribution: the average result over a very large number of repeats. It need not be a value that XX can actually take.

e.g. For P(X=0)=0.5P(X=0)=0.5 and P(X=1)=0.5P(X=1)=0.5, E(X)=0×0.5+1×0.5=0.5E(X)=0\times0.5+1\times0.5=0.5, even though XX is never 0.50.5.

What is a fair game?

A game is fair if the expected gain for the player is E(X)=0E(X)=0. A positive value favours the player and a negative value favours the organiser.

e.g. Winning 44 dollars with probability 0.20.2 or losing 11 dollar with probability 0.80.8 gives E(X)=4×0.2+(−1)×0.8=0E(X)=4\times0.2+(-1)\times0.8=0, so the game is fair.

Worked example, step by step

The question No calculator needed [5 marks]

A game is played once. The random variable XX is the gain, in dollars, of a player, and its probability distribution is given in the table.

x−2014P(X=x)2k0.3k0.1\begin{array}{c|cccc}x&-2&0&1&4\\ \hline P(X=x)&2k&0.3&k&0.1\end{array}

(a) Find the value of kk.

(b) Find E(X)E(X).

(c) Determine whether the game is fair. Give a reason for your answer.

Worked solution: worked example

Answer: (a) k=0.2k=0.2. (b) E(X)=−0.2E(X)=-0.2. (c) The game is not fair, because E(X)≠0E(X)\neq0; the player loses $0.20\$0.20 per game on average.

Step 1 - Use the fact that the probabilities add up to 1.

The table lists every value that XX can take, so 2k+0.3+k+0.1=1.2k+0.3+k+0.1=1. This simplifies to 3k+0.4=13k+0.4=1. M1 - Sum of the probabilities equal to 11: 2k+0.3+k+0.1=12k+0.3+k+0.1=1

Why? Every probability distribution has total probability 1. That is the only piece of information that links the unknown kk to the numbers in the table, so it is always the first equation to write.

Step 2 - Solve for k and find every probability.

3k=0.63k=0.6, so k=0.2k=0.2. Then P(X=−2)=2k=0.4P(X=-2)=2k=0.4 and P(X=1)=k=0.2P(X=1)=k=0.2. The probabilities are 0.4, 0.3, 0.2, 0.10.4,\ 0.3,\ 0.2,\ 0.1. A1 - k=0.2k=0.2

Why? Substitute kk back into the table. Each probability should lie between 0 and 1 and the four should add to 1, which is a quick check that kk is right.

Step 3 - Write the expected value sum.

Multiply each value of XX by its own probability: E(X)=(−2)(0.4)+0(0.3)+1(0.2)+4(0.1).E(X)=(-2)(0.4)+0(0.3)+1(0.2)+4(0.1). M1 - Use E(X)=∑xP(X=x)E(X)=\sum xP(X=x) with the values and probabilities

Why? The expected value is a weighted mean, so each outcome is weighted by how likely it is. Keep the negative gain −2-2 inside the sum with its sign, rather than adding it on at the end.

Step 4 - Evaluate.

E(X)=−0.8+0+0.2+0.4=−0.2.E(X)=-0.8+0+0.2+0.4=-0.2. A1 - E(X)=−0.2E(X)=-0.2

Why? Take care with the signs when adding. The negative term −0.8-0.8 outweighs the positive terms, so the total is negative, and a slip here would change the conclusion in part (c).

Step 5 - Interpret the answer.

A game is fair when E(X)=0E(X)=0. Here E(X)=−0.2E(X)=-0.2, which is not 00, so the game is not fair. On average the player loses $0.20\$0.20 per game, so the game favours the organiser. R1 - E(X)≠0E(X)\neq0, so the game is not fair

Why? Say both the comparison with 00 and what it means in context. A negative expected gain means that, over many plays, the player loses money on average.

Marks (5):
M1 Sum of the probabilities equal to 11: 2k+0.3+k+0.1=12k+0.3+k+0.1=1
A1 k=0.2k=0.2
M1 Use E(X)=∑xP(X=x)E(X)=\sum xP(X=x) with the values and probabilities
A1 E(X)=−0.2E(X)=-0.2
R1 E(X)≠0E(X)\neq0, so the game is not fair

Now you try: enter your answers to be marked

These are real practice questions. Type your answer in each box and press Mark it. The worked solution and mark scheme appear straight away, and your first attempt is the one that counts. Use the keyboard for powers, roots and trig, and the working box for your notes.

1
Easy
No calc
[3 marks]
The distribution of XX is given in the table.

xx123
P(X=x)P(X=x)0.20.5kk
(a) Find kk.
[2]
(b) Find P(X≥2)P(X\ge 2).
[1]
Fractions & powers
Other

Worked solution: practice question 1

2
Medium
No calc
[4 marks]
A random variable XX has P(X=x)=kxP(X=x) = kx for x=1,2,3,4x = 1,2,3,4.

xx1234
P(X=x)P(X=x)kk2k2k3k3k4k4k
(a) Find kk.
[2]
(b) Find E(X)E(X).
[2]
Fractions & powers
Other

Worked solution: practice question 2

3
Medium
Calculator
[4 marks]
A game costs $2 to play. You win $5 with probability 0.30.3, else nothing.

Find the expected profit per game.
[4]
Fractions & powers
Other

Worked solution: practice question 3

Your score so far: 0 out of 11 marks

Common mistakes

  • Forgetting the probabilities must sum to 1. If a table has an unknown kk, the very first step is almost always ∑P(X=x)=1\sum P(X=x)=1 - skipping this leaves kk unfound and every later part wrong.
  • Averaging the outcomes instead of weighting them. E(X)E(X) is not the plain mean of the xx-values - each outcome must be multiplied by its own probability before adding.
  • Missing negative payoffs in a game context. When a question involves a cost as well as a prize, the cost is a negative value of xx, not something to subtract at the end - it belongs inside the sum.

Try some questions on discrete random variables and expected value

Section 2 of 2 SL4.8

The binomial distribution

The binomial distribution X∼B(n,p)X\sim B(n,p) models the number of successes in nn independent trials, each with the same probability pp of success. Its mean is npnp and its variance is np(1−p)np(1-p), and its probabilities are found using technology. Check that the situation fits before writing X∼B(n,p)X\sim B(n,p).

Setup and formula

In examinations, binomial probabilities should be found using technology.

Key terms

What do nn and pp stand for in B(n,p)B(n,p)?

nn is the fixed number of trials and pp is the probability of success on each trial. The variable XX counts the number of successes.

e.g. Guessing 1212 questions with a 0.250.25 chance of success on each gives X∼B(12,0.25)X\sim B(12,0.25).

What counts as a success?

A success is the outcome you are counting, even if it is not good news, and a failure is everything else, with probability 1−p1-p.

e.g. If a component is defective with probability 0.050.05 and defects are being counted, a defective component is a success, and a working one is a failure with probability 0.950.95.

How do you find the mean and variance of a binomial variable?

Use E(X)=npE(X)=np and Var(X)=np(1−p)\text{Var}(X)=np(1-p). The standard deviation is the square root of the variance.

e.g. For X∼B(50,0.1)X\sim B(50,0.1), E(X)=50×0.1=5E(X)=50\times0.1=5 and Var(X)=50×0.1×0.9=4.5\text{Var}(X)=50\times0.1\times0.9=4.5.

How do you write 'at least' and 'at most' probabilities?

'At most kk' is P(X≤k)P(X\le k), 'fewer than kk' is P(X≤k−1)P(X\le k-1), and 'at least kk' is 1−P(X≤k−1)1-P(X\le k-1).

e.g. For X∼B(10,0.3)X\sim B(10,0.3), 'at least 33' is P(X≥3)=1−P(X≤2)P(X\ge3)=1-P(X\le2).

Worked example, step by step

The question Calculator needed (binomial probability) [6 marks]

A factory makes light bulbs. Each bulb is faulty with probability 0.060.06, independently of the other bulbs. A box contains 2525 bulbs. Let XX be the number of faulty bulbs in the box.

(a) Write down the distribution of XX, and state one assumption that is needed for this model.

(b) Find the probability that the box contains at least 33 faulty bulbs.

(c) Find the mean and the variance of XX.

Worked solution: worked example

Answer: (a) X∼B(25,0.06)X\sim B(25,0.06), with the bulbs independent and the probability of a fault constant. (b) P(X≥3)=0.187P(X\ge3)=0.187. (c) Mean 1.51.5, variance 1.411.41.

Step 1 - Identify the distribution.

There is a fixed number of trials, 2525 bulbs, each either faulty or not faulty, with the same probability of being faulty. Counting faulty bulbs gives X∼B(25,0.06).X\sim B(25,\,0.06). A1 - X∼B(25,0.06)X\sim B(25,0.06)

Why? A faulty bulb is a success because it is the outcome being counted, even though it is bad news. The two parameters are the number of trials n=25n=25 and the probability of success p=0.06p=0.06.

Step 2 - State the assumption.

The bulbs are independent of each other and the probability 0.060.06 is the same for every bulb. The question tells you this, so the model is valid. R1 - Independent trials with constant probability of a fault

Why? The binomial model needs independent trials with a constant probability of success. In a context question, say what the assumption means for the situation, not just its name.

Step 3 - Rewrite the probability in terms of a cumulative probability.

The calculator gives the probability of at most a value, so use the complement: P(X≥3)=1−P(X≤2).P(X\ge3)=1-P(X\le2). M1 - Use the complement: 1−P(X≤2)1-P(X\le2)

Why? "At least 33" covers 3,4,…,253,4,\ldots,25. It is quicker to subtract the cases that are not allowed, which are 0,1,20,1,2, from 11. The value you enter in the cumulative function is 22, not 33.

Step 4 - Use the calculator.

Use the binomial cumulative probability function with n=25n=25, p=0.06p=0.06 and 22: P(X≤2)=0.8129…P(X\le2)=0.8129\ldots So P(X≥3)=1−0.8129…=0.187.P(X\ge3)=1-0.8129\ldots=0.187. A1 - 0.1870.187

Why? Enter the number of trials first, then the probability, then the value. Keep the unrounded value of P(X≤2)P(X\le2) on the calculator and round only your final answer.

Step 5 - Find the mean and variance.

E(X)=np=25×0.06=1.5E(X)=np=25\times0.06=1.5 and Var(X)=np(1−p)=25×0.06×0.94=1.41\operatorname{Var}(X)=np(1-p)=25\times0.06\times0.94=1.41. A1 - Mean =1.5=1.5 A1 - Variance =1.41=1.41

Why? Both formulas are in the formula booklet. The variance has the factor 1−p1-p because it measures the spread caused by the chance of a success or a failure on each trial.

Marks (6):
A1 X∼B(25,0.06)X\sim B(25,0.06)
R1 Independent trials with constant probability of a fault
M1 Use the complement: 1−P(X≤2)1-P(X\le2)
A1 0.1870.187
A1 Mean =1.5=1.5
A1 Variance =1.41=1.41

Now you try: enter your answers to be marked

1
Easy
Calculator
[2 marks]
X∼B(10,0.3)X \sim B(10, 0.3).

Find P(X=4)P(X = 4)
[2]
Fractions & powers
Other

Worked solution: practice question 1

2
Medium
Calculator
[4 marks]
X∼B(12,0.5)X\sim B(12, 0.5).
(a) Find P(X≤4)P(X\le 4).
[2]
(b) Find P(X≥8)P(X\ge 8).
[2]
Fractions & powers
Other

Worked solution: practice question 2

3
Medium
No calc
[5 marks]
The random variable XX has a binomial distribution X∼B(n,p)X\sim\mathrm{B}(n,p). The mean of XX is 2424 and the variance of XX is 66.
(a) Find the value of pp.
[3]
(b) Find the value of nn.
[2]
Fractions & powers
Other

Worked solution: practice question 3

Your score so far: 0 out of 11 marks

Common mistakes

  • Not checking the four binomial conditions. A situation is only binomial if trials are fixed in number, independent, and have a constant probability of success - sampling without replacement from a small population breaks this.
  • Using binompdf when a range is needed. P(X≥2)P(X\ge 2) or P(X≤5)P(X\le 5) call for the cumulative function binomcdf (with a complement where needed), not binompdf, which only gives one exact value.
  • Confusing nn and pp in the GDC entry. The number of trials always goes first and the probability second - swapping them silently produces a completely different (and wrong) distribution.

Try some questions on the binomial distribution

Using your GDC

The exact key presses for the TI-84 Plus CE, Casio fx-CG50, Casio fx-CG100 and TI-Nspire CX, with what the screen shows. Pick your calculator.

Binomial distribution

Used in: The binomial distribution

How to find a binomial probability on a TI-84 Plus CE

binompdf and binomcdf

For exactly 8 (P(X=8)P(X = 8)), press 2nd vars (DISTR) and choose A:binompdf(. With the Stat Wizards on, a screen asks for each value in turn: type it and press enter each time.

Enter the number of trials 20, the probability of success 0.4 and the value of x, 8, then press enter on Paste.

binompdf(
trials:20
p:0.4
x value:8

Press enter to run it. If the Stat Wizards are off, type binompdf(20,0.4,8) with commas between the three values and press enter.

P(X=8)=0.180P(X = 8) = 0.180 to 3 significant figures.

binompdf(20,0.4,8)
0.1797058

For at most 8 (P(X≤8)P(X \le 8)), press 2nd vars (DISTR) and choose B:binomcdf(. It adds the probabilities from 0 up to x.

P(X≤8)=0.596P(X \le 8) = 0.596 to 3 significant figures.

binomcdf(20,0.4,8)
0.5955987

For at least 10 (P(X≥10)P(X \ge 10)), the calculator only adds up from 0, so find P(X≤9)P(X \le 9) and subtract it from 1: type 1-binomcdf(20,0.4,9).

P(X≥10)=0.245P(X \ge 10) = 0.245 to 3 significant figures.

1-binomcdf(20,0.4,9)
0.2446628

"At least 10" is 1 minus the cumulative probability up to 9, not up to 10. For "fewer than 10" use binomcdf at 9.

The full guide: Binomial distribution

See the full list of GDC guides for every calculator task.

Syllabus content covered

CodeSyllabus content
SL4.7Concept of discrete random variables and their probability distributions. Expected value (mean) for discrete data. Applications. E(X)=0E(X)=0 indicates a fair game where XX represents the gain of a player.
SL4.8Binomial distribution. Mean and variance of the binomial distribution. In examinations, binomial probabilities should be found using available technology.

Official IB source: Mathematics: analysis and approaches subject brief (PDF, ibo.org).

Quick questions

How do you find the expected value of a discrete random variable?

Multiply each possible value xx by its probability P(X=x)P(X=x), then add the results: E(X)=∑xP(X=x)E(X)=\sum xP(X=x).

What are the conditions for a binomial distribution?

A fixed number of trials nn, exactly two outcomes per trial, a constant probability of success pp, and independent trials. All four must hold before you can write X∼B(n,p)X\sim B(n,p).

How do you know a probability distribution table is valid?

All the probabilities must lie between 0 and 1, and the whole set of probabilities in the table must add up to exactly 1.

How do you calculate binomial probabilities on the GDC?

Use binompdf(n, p, x)\texttt{binompdf(n, p, x)} for an exact value P(X=x)P(X=x), or binomcdf(n, p, x)\texttt{binomcdf(n, p, x)} for a cumulative probability P(X≤x)P(X\le x). IB exams expect these to be found using technology.

How do I find a missing probability in a table?

Add the known probabilities and subtract the total from 11. If the known probabilities are 0.10.1, 0.40.4 and 0.30.3, the missing one is 1−0.8=0.21-0.8=0.2.

Why is 'at least one' easier to find using the complement?

'At least one' is every outcome except none, so P(X≥1)=1−P(X=0)P(X\ge1)=1-P(X=0). This avoids adding many separate probabilities.

Can the expected value be negative?

Yes. A negative E(X)E(X) means the average result is a loss. If XX takes −2-2 with probability 0.70.7 and 33 with probability 0.30.3, then E(X)=−1.4+0.9=−0.5E(X)=-1.4+0.9=-0.5.

Why is drawing cards without replacement not binomial?

Each draw changes the probability of success for the next draw, so the probability is not constant and the trials are not independent. Both conditions for a binomial model fail.

What is the difference between the expected value and the plain average of the values?

The plain average treats every value equally, but E(X)E(X) weights each value by its probability. For x=1x=1 and x=2x=2 with probabilities 0.90.9 and 0.10.1, the plain average is 1.51.5 but E(X)=0.9+0.2=1.1E(X)=0.9+0.2=1.1.

What values can X take in a binomial distribution?

XX can take the whole numbers from 00 to nn. For X∼B(8,0.25)X\sim B(8,0.25), the possible values are 0,1,2,…,80, 1, 2, \dots, 8.

Ready to practise properly?

Practice questions on every section, marked instantly like the real exam.