Worked examples
The question
Question: x can be 0, 1, 2, 3, with probabilities 0.1, 0.3, 0.4, 0.2: find the mean.
x: 0, 1, 2, 3; P(x): 0.1, 0.3, 0.4, 0.2. mean?
1 Check the table
The table lists each value of x and its probability, P of x.
A probability table must add up to 1.
0.1 plus 0.3 plus 0.4 plus 0.2 is 1.
Good.
0.1 + 0.3 + 0.4 + 0.2 = 1
2 Multiply x × P(x)
The mean of a random variable: each x times its probability, all added up.
mean μ = add up all x × P(x)
0 times 0.1 is 0.
1 times 0.3 is 0.3.
2 times 0.4 is 0.8.
3 times 0.2 is 0.6.
3 Add the column
0 plus 0.3 plus 0.8 plus 0.6 is 1.7.
The mean, μ, is 1.7.
μ = 0 + 0.3 + 0.8 + 0.6 = 1.7
Careful!
The plain average treats every x the same.
But the likely ones count more: we weight by P of x.
Careful: not (0 + 1 + 2 + 3) ÷ 4 = 1.5 ✗
4 Check
Let's check with 10 tries.
Each x comes up about 10 times its probability: 0, 1 times; 1, 3 times; 2, 4 times; 3, 2 times.
10 tries: 0 comes 1 times, 1 comes 3 times, 2 comes 4 times, 3 comes 2 times
All the x's of the 10 tries add up to 17.
total 0 × 1 + 1 × 3 + 2 × 4 + 3 × 2 = 17
17 divided by 10 is 1.7: the mean.
So it is right!
17 ÷ 10 = 1.7
Let's look back.
First: check the table.
Then: multiply x × P(x).
Then: add the column.
Last: check.
Answer Careful: not (0 + 1 + 2 + 3) ÷ 4 = 1.5 ✗
▶ Watch it solved
The question
Question: x can be 0, 1, 2, 3, with probabilities 0.15, 0.35, 0.3, 0.2: find the mean.
x: 0, 1, 2, 3; P(x): 0.15, 0.35, 0.3, 0.2. mean?
1 Check the table
The table lists each value of x and its probability, P of x.
A probability table must add up to 1.
0.15 plus 0.35 plus 0.3 plus 0.2 is 1.
Good.
0.15 + 0.35 + 0.3 + 0.2 = 1
2 Multiply x × P(x)
The mean of a random variable: each x times its probability, all added up.
mean μ = add up all x × P(x)
0 times 0.15 is 0.
1 times 0.35 is 0.35.
2 times 0.3 is 0.6.
3 times 0.2 is 0.6.
3 Add the column
0 plus 0.35 plus 0.6 plus 0.6 is 1.55.
The mean, μ, is 1.55.
μ = 0 + 0.35 + 0.6 + 0.6 = 1.55
Careful!
The plain average treats every x the same.
But the likely ones count more: we weight by P of x.
Careful: not (0 + 1 + 2 + 3) ÷ 4 = 1.5 ✗
4 Check
Let's check with 100 tries.
Each x comes up about 100 times its probability: 0, 15 times; 1, 35 times; 2, 30 times; 3, 20 times.
100 tries: 0 comes 15 times, 1 comes 35 times, 2 comes 30 times, 3 comes 20 times
All the x's of the 100 tries add up to 155.
total 0 × 15 + 1 × 35 + 2 × 30 + 3 × 20 = 155
155 divided by 100 is 1.55: the mean.
So it is right!
155 ÷ 100 = 1.55
Let's look back.
First: check the table.
Then: multiply x × P(x).
Then: add the column.
Last: check.
Answer Careful: not (0 + 1 + 2 + 3) ÷ 4 = 1.5 ✗
▶ Watch it solved
The question
Question: x can be 0, 1, 2, 3, 4, with probabilities 0.1, 0.2, 0.4, 0.2, 0.1: find the standard deviation.
x: 0, 1, 2, 3, 4; P(x): 0.1, 0.2, 0.4, 0.2, 0.1. SD?
1 The mean
The table lists each value of x and its probability, P of x.
The mean: each x times its probability.
0 times 0.1 is 0.
1 times 0.2 is 0.2.
2 times 0.4 is 0.8.
3 times 0.2 is 0.6.
4 times 0.1 is 0.4.
0 plus 0.2 plus 0.8 plus 0.6 plus 0.4 is 2.
μ = 0 + 0.2 + 0.8 + 0.6 + 0.4 = 2
2 Distance from the mean
The variance: how far each x is from the mean, squared, times its probability, all added up.
variance σ² = add up all (x − μ)² × P(x)
0 minus 2 is −2.
Squared: 4.
Times 0.1: 0.4.
1 minus 2 is −1.
Squared: 1.
Times 0.2: 0.2.
2 minus 2 is 0.
Squared: 0.
Times 0.4: 0.
3 minus 2 is 1.
Squared: 1.
Times 0.2: 0.2.
4 minus 2 is 2.
Squared: 4.
Times 0.1: 0.4.
3 Add: the variance
0.4 plus 0.2 plus 0 plus 0.2 plus 0.4 is 1.2.
The variance, sigma squared, is 1.2.
σ² = 0.4 + 0.2 + 0 + 0.2 + 0.4 = 1.2
4 Square root
The SD is the square root of the variance: about 1.0954.
σ = √1.2 ≈ 1.0954
Careful!
1.2 is the variance.
The SD is its square root.
Careful: not σ = 1.2 ✗
5 Check
Let's check with the other formula.
Each x squared times P of x: 0 plus 0.2 plus 1.6 plus 1.8 plus 1.6 is 5.2.
x² × P(x): 0 + 0.2 + 1.6 + 1.8 + 1.6 = 5.2
Minus the mean squared: 5.2 minus 4 is 1.2, the variance again.
So it is right!
5.2 − 2² = 5.2 − 4 = 1.2
Let's look back.
First: the mean.
Then: distance from the mean.
Then: add: the variance.
Then: square root.
Last: check.
Answer Careful: not σ = 1.2 ✗
▶ Watch it solved