Track 5 · Probability Distributions · Lesson 1 of 10
Random variables and their distributions
Describe a random variable with its pmf or pdf and cdf, and calculate its mean, variance and standard deviation.
An insurer cannot know how many claims a particular policy will produce next year, but it must still price the policy. Treating the claim count as a random variable with a distribution turns that uncertainty into numbers the insurer can plan with: the probability of no claim, the expected number of claims, and how much that number varies.
A random variable is a numerical outcome of a random process: the number of claims on a policy, the number of heads in ten tosses, the time until the next call arrives. We write it with a capital letter, , and a particular value it can take with a small letter, .
The distribution of lists which values are possible and how probable they are. Every model in this track — binomial, Poisson, normal, t and the rest — is a distribution with a name and a few parameters.
| Discrete | Continuous | |
|---|---|---|
| Values | Separate, countable values (0, 1, 2, …) | Any value in an interval |
| Typical source | Counting | Measuring (time, weight, distance) |
| Described by | Probability mass function (pmf) | Probability density function (pdf) |
| Probability of one exact value | Can be positive | Always 0 |
| Examples | Claims per policy, defective items in a batch | Waiting time, finish time of a race |
- the probability that takes exactly the value ; each is between 0 and 1
- the probabilities of all possible values add up to 1
- the cumulative distribution function (cdf): the probability that is at most . Convention: includes itself
For a discrete variable the cdf is a staircase: it jumps by at each possible value and is flat in between. Because the jump at belongs to , the two neighbouring questions have different answers:
Getting versus right is the most common source of wrong answers with discrete distributions.
- the expected value: the probability-weighted average of the possible values, i.e. the long-run average over many repetitions
- the variance: the probability-weighted average squared distance from (in squared units)
- , the expected value of the square of
- the standard deviation: the square root of the variance, in the same units as
Worked example
Complaints per day
A shop's number of customer complaints in a day, , has this distribution: , , , . Find , , the mean, the variance and the standard deviation.
Check it is a distribution. Every probability is between 0 and 1 and they sum to 1.00.
Cumulative probabilities. , but — the value 1 itself is excluded.
Mean. complaints per day.
Variance. , so complaints².
Standard deviation. complaints.
, , , , . Over many days the shop averages 0.75 complaints a day, even though no single day can have exactly 0.75 complaints.
A continuous random variable, such as a waiting time, can take any value in an interval. It is described by a probability density function : a curve that is never negative and has total area 1 underneath it. Probabilities are areas under the curve:
A single point has no width, so it has no area: for continuous , for every . That is why and are equal for continuous variables, unlike discrete ones. The mean and variance are defined as for discrete variables with the sum replaced by an integral.
Show the data as a table
| x (successes in 10 trials) | P(X = x) |
|---|---|
| 0 | 0.0282475 |
| 1 | 0.121061 |
| 2 | 0.233474 |
| 3 | 0.266828 |
| 4 | 0.200121 |
| 5 | 0.102919 |
| 6 | 0.0367569 |
| 7 | 0.00900169 |
| 8 | 0.0014467 |
| 9 | 0.000137781 |
| 10 | 0.0000059049 |
Quick check
The time a customer spends on hold is continuous. Which statement is true?
Dataset
Motor insurance claims
1,500 rows · one row = one motor policy (one policy year) · synthetic data
| Policy | Driver age band | Exposure (years) | Claims (claims) |
|---|---|---|---|
| POL0001 | 36-50 | 1 | 0 |
| POL0002 | 51-65 | 1 | 0 |
| POL0003 | 26-35 | 1 | 0 |
| POL0004 | 26-35 | 0.94 | 0 |
| POL0005 | 26-35 | 1 | 2 |
| POL0006 | 51-65 | 0.98 | 0 |
One row per motor policy in a (synthetic) insurer's portfolio. claim_count is a discrete random variable observed 1 500 times.
Exercises
The lesson is complete when every exercise is answered correctly. Hints are free; viewing a worked solution before solving means the exercise won't count towards mastery.
0 of 8 exercises correct (not saved — sign in to keep your progress)
Exercise 1 · Practice, difficulty 1 of 3
Discrete or continuous?
Classify each random variable as discrete or continuous.
Exercise 2 · Guided, difficulty 1 of 3
Expected number of items
is the number of items a visitor to an online shop puts in the basket. Its distribution is
| 0 | 1 | 2 | 3 | 4 | |
|---|---|---|---|---|---|
| 0.30 | 0.25 | 0.05 | 0.20 | 0.20 |
Find the expected value . Give your answer to 2 decimal places.
Exercise 3 · Practice, difficulty 2 of 3
Variance and standard deviation
The number of support tickets a technician closes in an hour has this distribution:
| 0 | 1 | 2 | 3 | 4 | |
|---|---|---|---|---|---|
| 0.25 | 0.20 | 0.20 | 0.20 | 0.15 |
The mean is . Find the variance and the standard deviation of , each to 4 decimal places.
Exercise 4 · Practice, difficulty 2 of 3
Reading the cdf: ≤ versus <
is the number of parcels a courier fails to deliver on a shift:
| 0 | 1 | 2 | 3 | 4 | 5 | |
|---|---|---|---|---|---|---|
| 0.15 | 0.10 | 0.25 | 0.20 | 0.15 | 0.15 |
Find and . Give both to 2 decimal places.
Exercise 5 · Practice, difficulty 2 of 3
The missing probability
A game awards points per round with the distribution below, but one probability is missing.
| 0 | 1 | 2 | 3 | 4 | |
|---|---|---|---|---|---|
| ? | 0.15 | 0.15 | 0.30 | 0.30 |
Find the missing probability , and then . Give both to 2 decimal places.
Exercise 6 · Challenge, difficulty 3 of 3
Probability as area under a density
The time (minutes) a printing job waits in a queue has density for (and 0 elsewhere): a triangle with total area 1.
Find to 4 decimal places. (Hint: the area under from 0 to is .)
Exercise 7 · Application, difficulty 2 of 3
The empirical distribution of claim counts
Treat claim_count in the insurance_claims dataset (1 500 policies) as observations of a random variable . Using the relative frequencies as probabilities, find the mean number of claims per policy (3 decimal places) and the proportion of policies with at least one claim, (4 decimal places).
Data: insurance_claims · Open in the lab to explore and calculate.
Exercise 8 · Interpretation, difficulty 2 of 3
What an expected value means
A raffle ticket's net gain (in SAR) has expected value and standard deviation . Which statement is correct?
What you can now do
- Classify a random variable as discrete or continuous
- Read probabilities from a pmf and a cdf, distinguishing P(X ≤ k) from P(X < k)
- Explain why P(X = x) = 0 for a continuous variable and find probabilities as areas
- Calculate the mean, variance and standard deviation of a discrete random variable and interpret the mean as a long-run average