ExamSaathi learning library · Government exams · SSC CGL quantitative foundations; published syllabus labelled 2024 · Quantitative aptitude

Random variables: expected value and variance of a distribution

Set out the probability distribution of a discrete random variable, fill in a missing probability, and work out its expected value, variance and standard deviation, including the expected gain from a game or lucky draw and the effect of scaling and shifting.

Status: original pilot lesson. Teacher review is pending. It is not a complete course or official exam material.

You will learn to

Before you start

You already know how to find the mean and standard deviation of a list of data. This lesson carries the same ideas over to chance. A random variable turns each outcome of a chance process into a number: W could be the number of power cuts in a town on one day, and G could be the rupees a player gains from one game. It is called discrete when its values can be listed, such as 0, 1, 2 and 3. Random variables get capital letters such as W and G, a small letter such as k stands for an unknown constant, and x always means multiply. The binomial and Poisson distributions, which follow fixed patterns, have lessons of their own; here the probabilities are simply given in a table.

The probability distribution table

A probability distribution lists every value of the random variable together with its probability, often in two rows: the values on top and their probabilities underneath. Two rules always hold. Each probability lies from 0 to 1, and the probabilities add up to exactly 1, because on any one occasion the variable takes exactly one of its values. The second rule fills gaps. If W takes the values 1, 2, 3 and 4 with probabilities 0.2, 0.35, 0.3 and an unknown p, then p = 1 - 0.85 = 0.15. If the probabilities are given as k, 2k, 3k and 4k, then 10k = 1 and k = 0.1. After finding a constant, check that no probability has become negative or larger than 1. The chance of a range of values is the sum of the matching entries, so in the first table P(W is 3 or more) = 0.3 + 0.15 = 0.45.

Expected value, variance and standard deviation

The expected value, or mean, of W is E(W) = sum of (value x probability). Think of it as the long-run average: if the chance process is repeated many times, the average of the values you see settles close to E(W). It need not be a value that W can actually take; an average of 1.7 power cuts a day makes perfect sense. Spread is measured as it is for data, but each term is weighted by its probability. First find E(W^2) = sum of (value^2 x probability). Then Var(W) = E(W^2) - (E(W))^2, the probability-weighted form of the shortcut you met for data. The longer route, sum of ((value - E(W))^2 x probability), gives the same answer. The standard deviation is SD(W) = sqrt(Var(W)), in the same unit as W. A tidy layout uses four columns: value, probability, value x probability and value^2 x probability. The totals of the last three columns are 1, E(W) and E(W^2).

Expected gain and fair games

In a game or a lucky draw, let G be the player's net gain in rupees: the prize won minus the amount paid to play, so a loss is a negative gain. Then E(G) = sum of (gain x probability). If E(G) is positive, the game favours the player in the long run; if it is negative, it favours the organiser; and if E(G) = 0, the game is fair. A quicker route is E(G) = expected prize - price of playing, so the fair price equals the expected prize. In a lucky draw where every ticket has the same chance, the probability of a particular prize is the number of such prizes divided by the number of tickets sold, so the expected prize per ticket is the total prize money divided by the number of tickets. The expected gain describes the average over many plays; it is not the amount that any one player actually receives.

Scaling and shifting a random variable

Often a new quantity is made from W by multiplying it by a number a and adding a number b, such as a seller's profit = (profit per item) x W - (fixed daily cost). Then E(aW + b) = a x E(W) + b, so the mean follows the same rule as each value. Adding b moves every value by the same amount and leaves the spread alone, while multiplying by a stretches every distance from the mean by the size of a. So Var(aW + b) = a^2 x Var(W), and SD(aW + b) = |a| x SD(W), where |a| is a without its minus sign. For example, if E(W) = 5 and Var(W) = 4, then G = 3W + 10 has E(G) = 3 x 5 + 10 = 25, Var(G) = 9 x 4 = 36 and SD(G) = 3 x 2 = 6. The constant b never enters the variance or the standard deviation.

Common mistakes

Averaging the values and ignoring their probabilities: E(W) weights each value by its chance, so it is not (sum of the values) / (number of values). Dividing the sum of value x probability by the number of values, which does the averaging twice. Forgetting to square E(W) in the variance, or squaring the probabilities instead of the values. Stopping at the variance when the standard deviation is asked for. Leaving out the price of playing, so that the expected prize is reported as the expected gain. Dividing the prize money by the number of prizes instead of the number of tickets, which forgets that most tickets win nothing. In aW + b, adding b to the variance, or multiplying the variance by a instead of a^2. Accepting a value of k that makes a probability negative or the total differ from 1.

A routine for random variable questions

1. List the values of the random variable with their probabilities and check that the probabilities add up to 1; use that fact to find any missing entry or constant. 2. Make columns for value x probability and value^2 x probability, and total them to get E(W) and E(W^2). 3. Variance = E(W^2) - (E(W))^2; take the square root for the standard deviation. 4. For a game, write each gain as prize minus price, find E(G), and call the game fair only when E(G) = 0. 5. For aW + b, use a x E(W) + b for the mean and a^2 x Var(W) for the variance. 6. Sense-check: E(W) is never below the smallest value of W or above the largest, and a variance is never negative.

Worked examples

  1. In summer, the number W of power cuts in a day in a ward of Gaya has this distribution: P(W = 0) = k, P(W = 1) = 3k, P(W = 2) = 4k and P(W = 3) = 2k. Find k, the probability of at least 2 power cuts in a day, and E(W).

    1. The probabilities must add up to 1: k + 3k + 4k + 2k = 10k = 1, so k = 0.1.
    2. The table becomes W = 0 with 0.1, W = 1 with 0.3, W = 2 with 0.4 and W = 3 with 0.2, and every entry lies from 0 to 1.
    3. P(at least 2 cuts) = P(W = 2) + P(W = 3) = 0.4 + 0.2 = 0.6.
    4. E(W) = 0 x 0.1 + 1 x 0.3 + 2 x 0.4 + 3 x 0.2 = 0 + 0.3 + 0.8 + 0.6 = 1.7.

    Answer: k = 0.1, P(at least 2 cuts) = 0.6, and E(W) = 1.7 power cuts a day.

  2. A home cook in Indore delivers W tiffin boxes in an hour, where W = 1, 2, 3 or 4 with probabilities 0.1, 0.5, 0.3 and 0.1. She makes Rs. 50 on each box and pays a delivery helper Rs. 30 an hour, so her hourly earning is G = 50W - 30 rupees. Find the variance and standard deviation of W, and the mean and standard deviation of G.

    1. Columns: value, probability, value x probability, value^2 x probability.
    2. W = 1: 0.1, 0.1, 0.1
    3. W = 2: 0.5, 1.0, 2.0
    4. W = 3: 0.3, 0.9, 2.7
    5. W = 4: 0.1, 0.4, 1.6
    6. Totals: the probabilities make 1, E(W) = 2.4 and E(W^2) = 6.4.
    7. Var(W) = 6.4 - 2.4^2 = 6.4 - 5.76 = 0.64 (boxes squared), so SD(W) = sqrt(0.64) = 0.8 boxes.
    8. E(G) = 50 x 2.4 - 30 = 120 - 30 = Rs. 90.
    9. SD(G) = 50 x 0.8 = Rs. 40, since the fixed Rs. 30 does not affect the spread. Check: Var(G) = 50^2 x 0.64 = 1600 (rupees squared), and sqrt(1600) = 40.

    Answer: Var(W) = 0.64 (boxes squared) and SD(W) = 0.8 boxes; her hourly earning has mean Rs. 90 and standard deviation Rs. 40.

  3. For a Diwali lucky draw in Varanasi, 500 tickets are sold at Rs. 20 each. The prizes are one of Rs. 2,000, two of Rs. 500 and five of Rs. 200, and every ticket has the same chance. Let G be a ticket holder's net gain in rupees. Find E(G), and the ticket price that would make the draw fair.

    1. Gains: 2000 - 20 = 1980 with probability 1/500; 500 - 20 = 480 with probability 2/500; 200 - 20 = 180 with probability 5/500; and -20 with probability 492/500 for the tickets that win nothing.
    2. E(G) = (1980 x 1 + 480 x 2 + 180 x 5 - 20 x 492) / 500 = (1980 + 960 + 900 - 9840) / 500 = -6000 / 500 = -12.
    3. Quick route: total prize money = 2000 + 1000 + 1000 = Rs. 4,000, so the expected prize per ticket is 4000 / 500 = Rs. 8, and E(G) = 8 - 20 = -12.
    4. The draw is fair when E(G) = 0, that is, when the ticket price equals the expected prize of Rs. 8.

    Answer: E(G) = -12, an expected loss of Rs. 12 per ticket; the draw would be fair at a ticket price of Rs. 8.

Practice checks

  1. The number W of goals a school football team in Kolkata scores in a match has P(W = 0) = 0.4, P(W = 1) = 3k, P(W = 2) = 2k and P(W = 3) = k. What is the probability that the team scores at least 2 goals in a match?
  2. At a tea stall in Darjeeling, the number W of cups a customer orders is 1, 2, 3 or 4, with probabilities 0.4, 0.3, 0.2 and 0.1. What is the expected number of cups per customer?
  3. A club bowler in Chennai takes W wickets in a match, where W = 0, 1, 2 or 3 with probabilities 0.2, 0.4, 0.3 and 0.1. What is the variance of W?
  4. At a mela in Ajmer, a wheel pays Rs. 100 with probability 0.05, pays Rs. 40 with probability 0.25, and pays nothing otherwise. What entry fee would make one spin of the wheel a fair game?
  5. A courier in Kochi delivers W parcels a day, with E(W) = 12 and Var(W) = 9. He earns Rs. 40 a parcel and spends Rs. 150 a day on fuel, so his daily profit is G = 40W - 150 rupees. What are the mean and the standard deviation of G?

Sources checked