Worked examples · Sheet 2
Expectations and variances from tables
Theory used:Moments of a discrete random variableMoments of an affine transformation
Go to: Exercise 1Exercise 2
Exercise 1
A prize pays , or euros with probabilities , and . Calculate the mean prize and its variance.
The three probabilities sum to , so the table defines a distribution and its moments can be calculated from their definitions. Each prize contributes to the mean in proportion to its probability. In particular, the prize of is twice as large as the prize of but half as likely. Their contributions to the mean are therefore equal, and the mean prize is .
For the second moment, weight the squared prizes by the same probabilities, applying with . This gives . Subtracting the square of the mean gives variance . The definition gives the same result: the deviations from the mean are , and , and the weighted mean of their squares is . The standard deviation, in the same units as the prize, is .
Exercise 2
A duration takes the values , and hours with masses , and . The cost in euros is . Calculate the mean and variance of the cost.
First calculate the mean and variance of the duration from the table for . For the second moment, replace , and by their squares , and . To subtract , write with denominator . The variance of the duration is therefore .
Cost is an affine transformation of duration with and , so the theorem on moments of an affine transformation applies. For mean cost, multiply the mean duration by the hourly rate and add the fixed fee. The mean cost is therefore . The fee shifts each cost and its mean by the same amount, so it cancels in the deviation. The hourly rate doubles each deviation from the mean duration, quadrupling the squared deviations. The cost variance is therefore .