Discrete and continuous random variables
In a minute
The measures how spread out a random variable is, and is the quick way to find it. A continuous variable is described by a : probabilities are areas under it, and integrals give its mean, variance, median and mode.
You'll be able to
- Find , the variance and the standard deviation of a discrete random variable.
- Use a probability density function, including a piecewise one: find an unknown constant and find probabilities as areas.
- Find the mode from the maximum of the density and the median from half the area.
- Find the mean, variance and standard deviation of a continuous random variable by integration.
- Use and , including to make a game fair.
Before you start3 quick questions on what this builds on
Revise first: 4.7 Discrete random variables and expected value, 5.8 Extrema, inflexion and optimisation and 5.11 Definite integrals and areas
Variance of a discrete random variable
In 4.7 you found the , the long-run mean of a . The mean alone hides a lot.
Picture two games that both pay $5 on average. One always pays $5. The other pays $0 or $10 with equal chance. Same mean, very different risk. You need a number for the spread.
Squaring stops the distances above and below the mean from cancelling. It also means a variance is never negative. If you get a negative variance, look for a slip.
Working out every is slow. Expanding the bracket gives a quicker form. You need , the expected value of : square each value, then weight it by its probability.
Both forms are in the formula booklet. Read the second one as: the mean of the squares, minus the square of the mean.
Try it first, then reveal one step at a time.
- Find the mean: .
- Square each value and weight it: .
- Subtract the square of the mean: .
- So the standard deviation is . Sense check: the values sit within about one unit of .
Try it first, then reveal one step at a time.
- The probabilities add up to : , so .
- Use the mean: , so .
- Subtract the first equation from the second: , so .
- Find .
- Then .
The same formula works for data in a frequency table. There, each relative frequency plays the part of a probability, as in 4.3.
Continuous random variables and density functions
A can take any value in an interval, such as a waiting time. You can't list its values, so you can't give each one a probability.
Instead, probability is spread along the -axis like paint, thick in some places and thin in others. A curve shows how thick. The probability of landing between and is the area under the curve there.
In practice outside some interval. So the integral only runs over the interval where is non-zero, using the where the formula applies.
A single point has no width, so . That means and are equal. Also, itself is not a probability. It can even be bigger than .
Try it first, then reveal one step at a time.
- The total area is : .
- Expand before integrating: .
- Integrate: .
- Substitute the limits: .
- So . Check: on , since and .
A density uses different formulas on different intervals. Split every integral at the points where the formula changes, and add the pieces.
Try it first, then reveal one step at a time.
- Split the total at : .
- Integrate each piece: .
- Solve : .
- For , take the whole first piece and part of the second: .
Mode and median
The mode and the median mean the same as for data in 4.3. For a density, you find them from the curve.
To find it, use 5.8: solve and check it is a maximum. Also compare the values at the ends of the interval, since the maximum can sit at an end. The mode is the -value, not the height .
Try it first, then reveal one step at a time.
- Expand: .
- Differentiate: .
- So at and . Now , while and .
- The largest value of on is at , so that is the mode. The height is not the answer.
For the median of a piecewise density, first find how much probability the first piece holds. That tells you which piece the median is in. The picture below shows it for the density from the last section.
Try it first, then reveal one step at a time.
- Find the area of the first piece: .
- Since , the median lies in the second piece, so .
- Add the area from to : , so .
- Solve: , so .
- Check: lies in , as it must.
Often the median equation can't be solved by algebra. On Paper 2, write the equation down, then solve it on your calculator.
Try it first, then reveal one step at a time.
- The median satisfies .
- Integrate: .
- Write the equation down before using the calculator: . This line earns the method mark.
- Graph both sides and find where they meet for :
- Sense check: the mode is , and the density has a long tail to the right. So the median sits a little above the mode.
Mean and variance of a continuous random variable
For a discrete variable, . For a continuous one, the sum becomes an integral, and becomes , the probability in a thin strip.
These are in the formula booklet. The second form is again , with . The standard deviation is , as before.
If the density is symmetric about a line , the mean is . You can state it without integrating.
Try it first, then reveal one step at a time.
- Multiply by first: .
- Integrate: .
- Now multiply by : .
- Substitute: .
- , so .
Try it first, then reveal one step at a time.
- Split each integral at . Write what you enter:
- Store it as A on the calculator, so you never retype a rounded value.
- Next, .
- So and
- Rounding the mean to first would give , which loses the accuracy mark.
Linear transformations and fair games
Suppose every value of is doubled and then is added. The mean is doubled and moved up by . The spread doubles too, but adding doesn't change it: every value slides along together.
Variance is measured in squared units. So when the values are multiplied by , the variance is multiplied by . This works for discrete and continuous variables alike.
Take the square root of the variance rule to get the standard deviation rule. The modulus is there because a standard deviation is never negative.
Try it first, then reveal one step at a time.
- Here and .
- Mean: .
- Variance: . The has no effect on spread.
- So the standard deviation of the charge is dollars, which is times .
In 4.7 you met a : one where the player's expected gain is . When a gain is built from a prize, a fee and a multiplier, the rule for gives the fair fee in one line.
Try it first, then reveal one step at a time.
- Find the mean prize: .
- The player's gain is : the doubled prize minus the fee.
- Use the linear rule: .
- A fair game needs , so .
- The fee doesn't change the spread: , whatever is.
Common mistakes
- Stopping at and calling it the variance. Always subtract .
- Integrating instead of for the mean. That just gives the total probability, .
- Using only one piece of a piecewise density, or the wrong limits. Split each integral where the formula changes, and start from the lowest value of .
- Giving the height of the density as the mode. The mode is the -value where is largest.
- Giving the variance when the question asks for the standard deviation. Take the square root.
- Rounding before squaring it. Store the full calculator value and round only the final answer.
Exam tips
- Show that a constant is : write over the whole range first, then work forwards to the given value. Don't start from the answer.
- On Paper 2, write down the integral or equation you put into the calculator, such as . That line earns the method mark.
- State or write down for a symmetric density: the line of symmetry is the mean, and no working is needed.
- For a median, check your answer lies in the interval where the density is non-zero, and in the piece you used.
Key takeaways
Practise this
19 past-paper questions on 4.14 in the AA HL bank, each with a mark scheme and a worked explanation.