TExcelTAD
Home › School Probability & Statistics on Paper › Expected Value, Variance, and Standard Deviation of Random Variables

Expected Value, Variance, and Standard Deviation of Random Variables

In Discrete Random Variables and Probability Distribution Tables, we learned how to assign probabilities P(X=xi)P(X = x_i) to each distinct outcome xix_i of a random experiment. A probability distribution table gives a complete blueprint of what could happen, but in practical decision-making, we need single numerical summaries to answer two central questions:

  1. Center (Long-Run Average): If this random experiment is repeated thousands of times, what average outcome should we expect per trial?
  2. Spread (Risk and Dispersion): How widely will individual outcomes scatter around that expected average?

On paper, we answer these questions using the Expected Value E(X)E(X), the Variance Var⁡(X)\operatorname{Var}(X), and the Standard Deviation σ(X)\sigma(X).


1. Conceptual Meaning of Expected Value

The Expected Value of a discrete random variable XX, commonly written as E(X)E(X) or the Greek letter μ\mu (mu), is the probability-weighted average of all possible numerical values of XX.

Unlike the simple arithmetic mean of raw data where each observation carries an equal weight of 1n\frac{1}{n}, the expected value multiplies each outcome xix_i by its theoretical likelihood P(X=xi)P(X = x_i).

[!IMPORTANT] The expected value E(X)E(X) does not have to be an outcome that XX can actually take. For instance, the expected value of rolling a standard 6-sided die is 3.53.5, even though a physical die can never show 3.53.5 pips. It represents the arithmetic mean of the outcomes over an infinite sequence of independent trials.


2. Core Formulas on Paper

Expected Value (Mean):μ=E(X)=∑i=1kxi⋅P(X=xi)Second Moment:E(X2)=∑i=1kxi2⋅P(X=xi)Variance (Definition):Var⁡(X)=σ2=∑i=1k(xi−μ)2⋅P(X=xi)Variance (Paper Shortcut):Var⁡(X)=σ2=E(X2)−[E(X)]2Standard Deviation:σ=Var⁡(X)=E(X2)−[E(X)]2\begin{aligned} \mathbf{Expected\ Value\ (Mean):} \quad \mu = E(X) &= \sum_{i=1}^{k} x_i \cdot P(X = x_i) \\ \mathbf{Second\ Moment:} \quad E(X^2) &= \sum_{i=1}^{k} x_i^2 \cdot P(X = x_i) \\ \mathbf{Variance\ (Definition):} \quad \operatorname{Var}(X) = \sigma^2 &= \sum_{i=1}^{k} (x_i - \mu)^2 \cdot P(X = x_i) \\ \mathbf{Variance\ (Paper\ Shortcut):} \quad \operatorname{Var}(X) = \sigma^2 &= E(X^2) - [E(X)]^2 \\ \mathbf{Standard\ Deviation:} \quad \sigma &= \sqrt{\operatorname{Var}(X)} = \sqrt{E(X^2) - [E(X)]^2} \end{aligned}

Linear Transformations of a Random Variable

When a random variable XX is scaled by a constant factor aa and shifted by a constant bb (Y=aX+bY = aX + b):

E(aX+b)=a⋅E(X)+bVar⁡(aX+b)=a2⋅Var⁡(X)σ(aX+b)=∣a∣⋅σ(X)\begin{aligned} E(aX + b) &= a \cdot E(X) + b \\ \operatorname{Var}(aX + b) &= a^2 \cdot \operatorname{Var}(X) \\ \sigma(aX + b) &= |a| \cdot \sigma(X) \end{aligned}

Adding a fixed baseline constant bb shifts the center by bb, but does not change the spread (Var⁡(X+b)=Var⁡(X)\operatorname{Var}(X + b) = \operatorname{Var}(X)). Multiplying by aa stretches both the mean and the standard deviation by ∣a∣|a|, which scales the variance by a2a^2.


3. The Paper Notebook 4-Column Table Layout

Calculating variance using the definition ∑(xi−μ)2P(X=xi)\sum (x_i - \mu)^2 P(X=x_i) requires subtracting μ\mu from every outcome, squaring decimals, and re-multiplying. On paper, this is tedious and prone to arithmetic mistakes.

The standard examination technique uses the Paper 4-Column Table:

Outcome xiProbability P(X=xi)Product xi⋅P(X=xi)Squared Product xi2⋅P(X=xi)x1p1x1p1x12p1x2p2x2p2x22p2⋮⋮⋮⋮xkpkxkpkxk2pkΣ (Total)∑pi=1E(X)=∑xipiE(X2)=∑xi2pi\begin{array}{|c|c|c|c|} \hline \text{Outcome } x_i & \text{Probability } P(X = x_i) & \text{Product } x_i \cdot P(X = x_i) & \text{Squared Product } x_i^2 \cdot P(X = x_i) \\ \hline x_1 & p_1 & x_1 p_1 & x_1^2 p_1 \\ x_2 & p_2 & x_2 p_2 & x_2^2 p_2 \\ \vdots & \vdots & \vdots & \vdots \\ x_k & p_k & x_k p_k & x_k^2 p_k \\ \hline \mathbf{\Sigma\ (Total)} & \sum p_i = 1 & E(X) = \sum x_i p_i & E(X^2) = \sum x_i^2 p_i \\ \hline \end{array}

Once the two bottom sums are computed:

  1. Column 3 total gives E(X)E(X).
  2. Column 4 total gives E(X2)E(X^2).
  3. Subtract: Var⁡(X)=E(X2)−[E(X)]2\operatorname{Var}(X) = E(X^2) - [E(X)]^2.
  4. Take the principal square root: σ=Var⁡(X)\sigma = \sqrt{\operatorname{Var}(X)}.

4. Step-by-Step Worked Examples

Worked Example 1: The Carnival Wheel and Fair Game Analysis

Problem: A school festival booth features a spinning wheel divided into 8 equal sectors:

  • 1 sector awards $20\$20
  • 2 sectors award $10\$10
  • 5 sectors award $0\$0

It costs $4\$4 to play the game once. Let XX represent the gross prize payout, and let WW represent the player's net financial gain (W=X−4W = X - 4).

  1. Construct the probability distribution table for XX.
  2. Calculate the expected gross payout E(X)E(X).
  3. Calculate the expected net gain E(W)E(W). Is the game "fair"?
  4. Compute the variance Var⁡(X)\operatorname{Var}(X) and standard deviation σ(X)\sigma(X) of the payout.

Step 1: Probability Distribution of XX

Each sector has probability 18\frac{1}{8}.

  • P(X=20)=18P(X = 20) = \frac{1}{8}
  • P(X=10)=28=14P(X = 10) = \frac{2}{8} = \frac{1}{4}
  • P(X=0)=58P(X = 0) = \frac{5}{8}

Check probability sum: 18+28+58=88=1\frac{1}{8} + \frac{2}{8} + \frac{5}{8} = \frac{8}{8} = 1.

Step 2: 4-Column Table on Paper

xiP(X=xi)xi⋅P(X=xi)xi2⋅P(X=xi)2018208=52=2.50400×18=50.001028208=52=2.50100×28=25.000580.000.00Σ1.00E(X)=5.00E(X2)=75.00\begin{array}{|c|c|c|c|} \hline x_i & P(X = x_i) & x_i \cdot P(X = x_i) & x_i^2 \cdot P(X = x_i) \\ \hline 20 & \frac{1}{8} & \frac{20}{8} = \frac{5}{2} = 2.50 & 400 \times \frac{1}{8} = 50.00 \\ 10 & \frac{2}{8} & \frac{20}{8} = \frac{5}{2} = 2.50 & 100 \times \frac{2}{8} = 25.00 \\ 0 & \frac{5}{8} & 0.00 & 0.00 \\ \hline \mathbf{\Sigma} & \mathbf{1.00} & \mathbf{E(X) = 5.00} & \mathbf{E(X^2) = 75.00} \\ \hline \end{array}

Step 3: Compute Expected Values and Fair Game Status

The expected gross payout is:

E(X)=$5.00E(X) = \$5.00

Using the linear property E(W)=E(X−4)=E(X)−4E(W) = E(X - 4) = E(X) - 4:

E(W)=$5.00−$4.00=+$1.00E(W) = \$5.00 - \$4.00 = +\$1.00

[!NOTE] In mathematics, a game is strictly fair if and only if the expected net gain is zero: E(W)=0E(W) = 0. Since E(W)=+$1.00>0E(W) = +\$1.00 > 0, the game is favorable to the player (the booth loses $1.00\$1.00 on average per player).

Step 4: Compute Variance and Standard Deviation

Using the paper shortcut formula:

Var⁡(X)=E(X2)−[E(X)]2=75.00−(5.00)2=75.00−25.00=50.00 dollars2\begin{aligned} \operatorname{Var}(X) &= E(X^2) - [E(X)]^2 \\ &= 75.00 - (5.00)^2 \\ &= 75.00 - 25.00 \\ &= 50.00\ \text{dollars}^2 \end{aligned}

Standard deviation:

σ(X)=50.00≈7.07 dollars\sigma(X) = \sqrt{50.00} \approx 7.07\ \text{dollars}

Worked Example 2: Insurance Claim Risk Assessment

Problem: An electronics insurance company covers a smartphone against accidental screen damage over a 1-year period. Let YY be the repair payout amount in dollars with the following paper probability distribution:

yi ($)080200500P(Y=yi)0.700.150.100.05\begin{array}{|c|c|c|c|c|} \hline y_i\ (\$) & 0 & 80 & 200 & 500 \\ \hline P(Y = y_i) & 0.70 & 0.15 & 0.10 & 0.05 \\ \hline \end{array}
  1. Verify that this is a valid probability distribution.
  2. Find the expected repair payout μ=E(Y)\mu = E(Y).
  3. Determine the variance σ2\sigma^2 and standard deviation σ\sigma.
  4. If the company charges an annual premium of $60\$60 and incurs a fixed administrative cost of $10\$10 per policy, write the profit equation Z=60−10−Y=50−YZ = 60 - 10 - Y = 50 - Y and compute E(Z)E(Z) and σ(Z)\sigma(Z).

Step 1: Verification

∑P(Y=yi)=0.70+0.15+0.10+0.05=1.00✓\sum P(Y = y_i) = 0.70 + 0.15 + 0.10 + 0.05 = 1.00 \quad \checkmark

All individual probabilities satisfy 0≤P(Y=yi)≤10 \le P(Y = y_i) \le 1.

Step 2: 4-Column Paper Table Setup

yiP(Y=yi)yi⋅P(Y=yi)yi2⋅P(Y=yi)00.7000800.1512.006,400×0.15=9602000.1020.0040,000×0.10=4,0005000.0525.00250,000×0.05=12,500Σ1.00E(Y)=57.00E(Y2)=17,460\begin{array}{|c|c|c|c|} \hline y_i & P(Y = y_i) & y_i \cdot P(Y = y_i) & y_i^2 \cdot P(Y = y_i) \\ \hline 0 & 0.70 & 0 & 0 \\ 80 & 0.15 & 12.00 & 6{,}400 \times 0.15 = 960 \\ 200 & 0.10 & 20.00 & 40{,}000 \times 0.10 = 4{,}000 \\ 500 & 0.05 & 25.00 & 250{,}000 \times 0.05 = 12{,}500 \\ \hline \mathbf{\Sigma} & \mathbf{1.00} & E(Y) = \mathbf{57.00} & E(Y^2) = \mathbf{17{,}460} \\ \hline \end{array}
  • Expected payout:
μ=E(Y)=0+12+20+25=$57.00\mu = E(Y) = 0 + 12 + 20 + 25 = \$57.00

Step 3: Variance and Standard Deviation

Var⁡(Y)=E(Y2)−[E(Y)]2=17,460−(57)2=17,460−3,249=14,211 dollars2\begin{aligned} \operatorname{Var}(Y) &= E(Y^2) - [E(Y)]^2 \\ &= 17{,}460 - (57)^2 \\ &= 17{,}460 - 3{,}249 \\ &= 14{,}211\ \text{dollars}^2 \end{aligned}

Taking the square root on paper:

σ=14,211≈119.21 dollars\sigma = \sqrt{14{,}211} \approx 119.21\ \text{dollars}

Step 4: Company Profit Distribution Z=50−YZ = 50 - Y

Using linear transformation rules:

E(Z)=E(50−Y)=50−E(Y)=50−57=−$7.00Var⁡(Z)=Var⁡(50−Y)=(−1)2⋅Var⁡(Y)=14,211 dollars2σ(Z)=∣−1∣⋅σ(Y)=$119.21\begin{aligned} E(Z) &= E(50 - Y) = 50 - E(Y) = 50 - 57 = -\$7.00 \\ \operatorname{Var}(Z) &= \operatorname{Var}(50 - Y) = (-1)^2 \cdot \operatorname{Var}(Y) = 14{,}211\ \text{dollars}^2 \\ \sigma(Z) &= |-1| \cdot \sigma(Y) = \$119.21 \end{aligned}

Interpretation: The company loses an average of $7.00\$7.00 per customer at this premium price. The premium must be increased above $67.00\$67.00 to break even.


Worked Example 3: Finding an Unknown Probability and Payout

Problem: A discrete random variable XX has outcomes {1,2,3,4}\{1, 2, 3, 4\}. The distribution is partially known:

  • P(X=1)=0.2P(X = 1) = 0.2
  • P(X=2)=2kP(X = 2) = 2k
  • P(X=3)=kP(X = 3) = k
  • P(X=4)=0.2P(X = 4) = 0.2
  1. Find the value of the constant kk.
  2. Calculate E(X)E(X).
  3. Determine Var⁡(X)\operatorname{Var}(X).

Step 1: Solve for kk using ∑P=1\sum P = 1

0.2+2k+k+0.2=13k+0.4=13k=0.6k=0.2\begin{aligned} 0.2 + 2k + k + 0.2 &= 1 \\ 3k + 0.4 &= 1 \\ 3k &= 0.6 \\ k &= 0.2 \end{aligned}

Thus:

  • P(X=2)=2(0.2)=0.4P(X = 2) = 2(0.2) = 0.4
  • P(X=3)=0.2P(X = 3) = 0.2

Step 2: 4-Column Table

xiP(X=xi)xiP(X=xi)xi2P(X=xi)10.20.21×0.2=0.220.40.84×0.4=1.630.20.69×0.2=1.840.20.816×0.2=3.2Σ1.0E(X)=2.4E(X2)=6.8\begin{array}{|c|c|c|c|} \hline x_i & P(X = x_i) & x_i P(X = x_i) & x_i^2 P(X = x_i) \\ \hline 1 & 0.2 & 0.2 & 1 \times 0.2 = 0.2 \\ 2 & 0.4 & 0.8 & 4 \times 0.4 = 1.6 \\ 3 & 0.2 & 0.6 & 9 \times 0.2 = 1.8 \\ 4 & 0.2 & 0.8 & 16 \times 0.2 = 3.2 \\ \hline \mathbf{\Sigma} & \mathbf{1.0} & E(X) = \mathbf{2.4} & E(X^2) = \mathbf{6.8} \\ \hline \end{array}

Step 3: Compute Variance

Var⁡(X)=E(X2)−[E(X)]2=6.8−(2.4)2=6.8−5.76=1.04\begin{aligned} \operatorname{Var}(X) &= E(X^2) - [E(X)]^2 \\ &= 6.8 - (2.4)^2 \\ &= 6.8 - 5.76 \\ &= 1.04 \end{aligned}

Standard deviation: σ=1.04≈1.0198\sigma = \sqrt{1.04} \approx 1.0198.


5. Common Mistakes & Paper Traps

[!WARNING] Trap 1: Squaring the probability instead of the outcome. When computing E(X2)E(X^2), students sometimes calculate ∑xi[P(X=xi)]2\sum x_i [P(X = x_i)]^2. This is completely wrong! Always remember: the outcome is squared, never the probability:

E(X2)=∑xi2⋅P(X=xi)E(X^2) = \sum x_i^2 \cdot P(X = x_i)

[!CAUTION] Trap 2: Forgetting to square E(X)E(X) in the shortcut formula. Writing Var⁡(X)=E(X2)−E(X)\operatorname{Var}(X) = E(X^2) - E(X) instead of E(X2)−[E(X)]2E(X^2) - [E(X)]^2 is one of the most frequent examination errors. If your calculated variance is negative, stop immediately: variance can never be negative! A negative result is proof that you made an arithmetic error.

[!WARNING] Trap 3: Forgetting the negative sign squared in linear transformations. If Y=−3X+4Y = -3X + 4, the variance is:

Var⁡(Y)=(−3)2⋅Var⁡(X)=9⋅Var⁡(X)\operatorname{Var}(Y) = (-3)^2 \cdot \operatorname{Var}(X) = 9 \cdot \operatorname{Var}(X)

Never write −9Var⁡(X)-9 \operatorname{Var}(X) or −3σ(X)-3\sigma(X). Dispersion measures (σ\sigma and σ2\sigma^2) are strictly non-negative.


6. Pencil & Paper Practice

Practice 1

A fair four-sided die (tetrahedral die numbered 1,2,3,41, 2, 3, 4) is rolled once. Let XX be the number facing down.

  1. Write the probability distribution table.
  2. Calculate E(X)E(X) on paper.
  3. Calculate E(X2)E(X^2) and find Var⁡(X)\operatorname{Var}(X) and σ(X)\sigma(X).

??? success "Solution to Practice 1" Each outcome has probability P(X=x)=14P(X = x) = \frac{1}{4}.

Set up the paper table:
```math
\begin{array}{|c|c|c|c|}
\hline
x_i & P(X = x_i) & x_i P(X = x_i) & x_i^2 P(X = x_i) \\
\hline
1 & \frac{1}{4} & \frac{1}{4} & 1 \times \frac{1}{4} = \frac{1}{4} \\
2 & \frac{1}{4} & \frac{2}{4} & 4 \times \frac{1}{4} = \frac{4}{4} \\
3 & \frac{1}{4} & \frac{3}{4} & 9 \times \frac{1}{4} = \frac{9}{4} \\
4 & \frac{1}{4} & \frac{4}{4} & 16 \times \frac{1}{4} = \frac{16}{4} \\
\hline
\mathbf{\Sigma} & \mathbf{1} & \mathbf{\frac{10}{4} = 2.5} & \mathbf{\frac{30}{4} = 7.5} \\
\hline
\end{array}
```

1. $E(X) = \frac{10}{4} = 2.5$
2. $E(X^2) = \frac{30}{4} = 7.5$
3. Variance:
```math
\operatorname{Var}(X) = 7.5 - (2.5)^2 = 7.5 - 6.25 = 1.25 = \frac{5}{4}
```
Standard deviation: $\sigma = \sqrt{1.25} \approx 1.118$.

Practice 2

Let XX have mean E(X)=12E(X) = 12 and standard deviation σ(X)=3\sigma(X) = 3. Define Y=4−2XY = 4 - 2X.

  1. Find E(Y)E(Y).
  2. Find Var⁡(Y)\operatorname{Var}(Y).
  3. Find σ(Y)\sigma(Y).

??? success "Solution to Practice 2" First find the variance of XX: math \operatorname{Var}(X) = \sigma^2 = 3^2 = 9

1. Expected value:
```math
E(Y) = E(4 - 2X) = 4 - 2 E(X) = 4 - 2(12) = 4 - 24 = -20
```

2. Variance:
```math
\operatorname{Var}(Y) = (-2)^2 \cdot \operatorname{Var}(X) = 4 \times 9 = 36
```

3. Standard deviation:
```math
\sigma(Y) = \sqrt{36} = 6 \quad \text{or} \quad |-2| \cdot \sigma(X) = 2 \times 3 = 6
```

Test yourself

A random variable XX has outcomes 0,2,40, 2, 4 with probabilities 0.3,0.5,0.20.3, 0.5, 0.2 respectively. What is E(X)E(X)?

  1. 1.41.4
  2. 1.81.8
  3. 2.02.0
  4. 2.42.4

For a discrete random variable XX, you calculated E(X)=3E(X) = 3 and E(X2)=13E(X^2) = 13. What is the variance Var⁡(X)\operatorname{Var}(X)?

  1. 1010
  2. 44
  3. −4-4
  4. 2222

If random variable XX has variance Var⁡(X)=5\operatorname{Var}(X) = 5, what is the variance of Y=7−3XY = 7 - 3X?

  1. −15-15
  2. 1515
  3. 4545
  4. 5252