Solved Exercises on Variance and Standard Deviation of a Random Variable

Master variance and standard deviation calculations: calculating, interpreting, and applying properties through these 5 detailed exercises.

Solution: Exercises 1 to 3
1 Fair Die Variance and Standard Deviation
Exercise 1
A fair six-sided die is rolled. Let X be the number shown on the die. Calculate the variance and standard deviation of X.
Definition:

Variance: The average of the squared differences from the mean.

Formula: Var(X) = E[(X - μ)²] = E[X²] - (E[X])²

Standard Deviation: σ = √Var(X), measures spread in original units.

Method for calculating variance:
  1. Calculate E[X] (expected value)
  2. Calculate E[X²] (expected value of squares)
  3. Use formula: Var(X) = E[X²] - (E[X])²
  4. Calculate SD(X) = √Var(X)
X (value) P(X = x) x × P(X = x) x² × P(X = x) 1 1/6 1 × 1/6 = 1/6 1² × 1/6 = 1/6 2 1/6 2 × 1/6 = 2/6 2² × 1/6 = 4/6 3 1/6 3 × 1/6 = 3/6 3² × 1/6 = 9/6 4 1/6 4 × 1/6 = 4/6 4² × 1/6 = 16/6 5 1/6 5 × 1/6 = 5/6 5² × 1/6 = 25/6 6 1/6 6 × 1/6 = 6/6 6² × 1/6 = 36/6
Step 1: Calculate E[X]

E[X] = 1/6 + 2/6 + 3/6 + 4/6 + 5/6 + 6/6 = 21/6 = 3.5

Step 2: Calculate E[X²]

E[X²] = 1/6 + 4/6 + 9/6 + 16/6 + 25/6 + 36/6

= (1 + 4 + 9 + 16 + 25 + 36)/6 = 91/6 ≈ 15.167

Step 3: Calculate variance

Var(X) = E[X²] - (E[X])²

= 91/6 - (21/6)²

= 91/6 - 441/36

= 546/36 - 441/36 = 105/36 = 35/12 ≈ 2.917

Step 4: Calculate standard deviation

SD(X) = √Var(X) = √(35/12) ≈ 1.708

Mean (μ)
3.5
Variance
2.917
Std Dev
1.708
Var(X) = 35/12 ≈ 2.917, SD(X) ≈ 1.708
Final answer:

The variance of rolling a fair six-sided die is 35/12 ≈ 2.917.

The standard deviation is √(35/12) ≈ 1.708.

Applied rules:

• Variance Formula: Var(X) = E[X²] - (E[X])²

• Standard Deviation: SD(X) = √Var(X)

• Units: Variance in squared units, SD in original units

2 Investment Risk Comparison
Exercise 2
Two investments have the following return distributions: Investment A: P(X=5%)=0.3, P(X=10%)=0.4, P(X=15%)=0.3. Investment B: P(Y=2%)=0.2, P(Y=8%)=0.6, P(Y=20%)=0.2. Calculate variance and standard deviation for each and compare their risk levels.
Definition:

Risk: Measured by variance/standard deviation - higher values indicate greater uncertainty.

Investment Risk: Higher standard deviation means more volatility in returns.

Investment A Return (X) P(X = x) x × P(X = x) x² × P(X = x) 5% 0.3 5% × 0.3 = 1.5% 25%² × 0.3 = 7.5%² 10% 0.4 10% × 0.4 = 4.0% 100%² × 0.4 = 40.0%² 15% 0.3 15% × 0.3 = 4.5% 225%² × 0.3 = 67.5%² Totals 1.0 E[X] = 10% E[X²] = 115%²
Investment B Return (Y) P(Y = y) y × P(Y = y) y² × P(Y = y) 2% 0.2 2% × 0.2 = 0.4% 4%² × 0.2 = 0.8%² 8% 0.6 8% × 0.6 = 4.8% 64%² × 0.6 = 38.4%² 20% 0.2 20% × 0.2 = 4.0% 400%² × 0.2 = 80.0%² Totals 1.0 E[Y] = 9.2% E[Y²] = 119.2%²
Step 1: Calculate E[X] and E[X²] for Investment A

E[X] = 1.5% + 4.0% + 4.5% = 10%

E[X²] = 7.5%² + 40.0%² + 67.5%² = 115%²

Step 2: Calculate Var(X) and SD(X) for Investment A

Var(X) = E[X²] - (E[X])² = 115%² - (10%)² = 115%² - 100%² = 15%²

SD(X) = √15%² ≈ 3.87%

Step 3: Calculate E[Y] and E[Y²] for Investment B

E[Y] = 0.4% + 4.8% + 4.0% = 9.2%

E[Y²] = 0.8%² + 38.4%² + 80.0%² = 119.2%²

Step 4: Calculate Var(Y) and SD(Y) for Investment B

Var(Y) = E[Y²] - (E[Y])² = 119.2%² - (9.2%)² = 119.2%² - 84.64%² = 34.56%²

SD(Y) = √34.56%² ≈ 5.88%

Step 5: Compare risk levels

Investment A: E[X] = 10%, SD(X) = 3.87%

Investment B: E[Y] = 9.2%, SD(Y) = 5.88%

Investment B has higher risk (higher standard deviation) despite slightly lower expected return.

Investment A
SD = 3.87%
Investment B
SD = 5.88%
Riskier?
Investment B
A: SD = 3.87%, B: SD = 5.88% (B is riskier)
Final answer:

Investment A: Variance = 15%², Standard Deviation ≈ 3.87%

Investment B: Variance = 34.56%², Standard Deviation ≈ 5.88%

Investment B is riskier due to higher standard deviation.

Applied rules:

• Variance Formula: Var(X) = E[X²] - (E[X])²

• Risk Assessment: Higher SD indicates higher risk

• Trade-off: Higher expected return may come with higher risk

3 Coin Flip Game Variance
Exercise 3
In a coin flip game, you win $4 if you get heads and lose $2 if you get tails. Calculate the variance and standard deviation of your winnings per flip.
Definition:

Winnings Distribution: P(X = $4) = 0.5, P(X = -$2) = 0.5.

Spread Measurement: Variance quantifies how far values deviate from the mean.

Outcome Winnings (X) P(X = x) x × P(X = x) x² × P(X = x) Heads $4 0.5 4 × 0.5 = $2 16 × 0.5 = $8 Tails -$2 0.5 -2 × 0.5 = -$1 4 × 0.5 = $2 Totals 1.0 E[X] = $1 E[X²] = $10
Step 1: Calculate E[X]

E[X] = $2 + (-$1) = $1

Step 2: Calculate E[X²]

E[X²] = $8 + $2 = $10

Step 3: Calculate variance

Var(X) = E[X²] - (E[X])²

= $10 - ($1)²

= $10 - $1 = $9

Step 4: Calculate standard deviation

SD(X) = √$9 = $3

Step 5: Interpret results

Expected winnings per flip: $1

Typical deviation from expected value: $3

Large standard deviation indicates high variability in outcomes.

Mean
$1
Variance
$9
Std Dev
$3
Var(X) = $9, SD(X) = $3
Final answer:

The variance of winnings per flip is $9.

The standard deviation is $3, indicating significant variability in outcomes.

Applied rules:

• Variance Formula: Var(X) = E[X²] - (E[X])²

• Interpretation: SD shows typical deviation from mean

• Units: Variance in squared units, SD in original units

Variance and Standard Deviation: Core Concepts
Var(X) = E[X^2] - (E[X])^2
Variance Formula
Variance
σ² = Var(X)
Squared deviations
Standard Deviation
σ = √Var(X)
Original units
Key definitions:

Variance: The average of the squared differences from the mean, measuring spread of the distribution.

Standard Deviation: The square root of variance, expressed in the same units as the original data.

Dispersion: How spread out the values of a random variable are around the mean.

Units: Variance in squared units, standard deviation in original units.

Properties of Variance: 1) Var(c) = 0 (constant), 2) Var(aX + b) = a²Var(X)
Interpretation: Higher values indicate greater spread/variability in outcomes.
Tip 1: Always calculate E[X] first, then E[X²], before computing variance.
Tip 2: Standard deviation is more interpretable than variance because it's in original units.
Tip 3: Variance is always non-negative, and equals zero only for constant random variables.
Essential formulas:

• Variance: Var(X) = E[X²] - (E[X])²

• Standard Deviation: SD(X) = √Var(X)

• Linear Transformation: Var(aX + b) = a²Var(X)

• Constant: Var(c) = 0

Solution: Exercises 4 to 5
4 Linear Transformation of Variance
Exercise 4
If X has mean μ = 5 and variance σ² = 4, find the mean and variance of Y = 3X - 2. Then calculate the standard deviation of Y.
Definition:

Linear Transformation: When Y = aX + b, the mean and variance transform predictably.

Scaling Effect: Variance is affected by the square of the scaling factor.

Step 1: Given information

E[X] = μ = 5

Var(X) = σ² = 4

Y = 3X - 2 (so a = 3, b = -2)

Step 2: Calculate E[Y]

Using the linear property: E[aX + b] = aE[X] + b

E[Y] = E[3X - 2] = 3E[X] - 2 = 3(5) - 2 = 15 - 2 = 13

Step 3: Calculate Var(Y)

Using the variance transformation property: Var(aX + b) = a²Var(X)

Var(Y) = Var(3X - 2) = 3²Var(X) = 9 × 4 = 36

Step 4: Calculate SD(Y)

SD(Y) = √Var(Y) = √36 = 6

Step 5: Verify with alternative calculation

Var(Y) = E[Y²] - (E[Y])²

Y² = (3X - 2)² = 9X² - 12X + 4

E[Y²] = E[9X² - 12X + 4] = 9E[X²] - 12E[X] + 4

Since Var(X) = E[X²] - (E[X])², we have E[X²] = Var(X) + (E[X])² = 4 + 25 = 29

So E[Y²] = 9(29) - 12(5) + 4 = 261 - 60 + 4 = 205

Var(Y) = 205 - 13² = 205 - 169 = 36 ✓

E[Y]
13
Var(Y)
36
SD(Y)
6
E[Y] = 13, Var(Y) = 36, SD(Y) = 6
Final answer:

For Y = 3X - 2: E[Y] = 13, Var(Y) = 36, SD(Y) = 6.

The mean was shifted by -2 and scaled by 3, while variance was scaled by 3² = 9.

Applied rules:

• Mean Transformation: E[aX + b] = aE[X] + b

• Variance Transformation: Var(aX + b) = a²Var(X)

• Standard Deviation: SD(aX + b) = |a|SD(X)

5 Probability Distribution Variance
Exercise 5
A discrete random variable X has the following probability distribution: P(X=0)=0.1, P(X=1)=0.3, P(X=2)=0.4, P(X=3)=0.2. Calculate the variance and standard deviation of X.
Definition:

Probability Distribution: Complete specification of all possible values and their probabilities.

Variance Calculation: Requires computing E[X] and E[X²] from the distribution.

X P(X = x) x × P(X = x) x² × P(X = x) 0 0.1 0 × 0.1 = 0 0² × 0.1 = 0 1 0.3 1 × 0.3 = 0.3 1² × 0.3 = 0.3 2 0.4 2 × 0.4 = 0.8 2² × 0.4 = 1.6 3 0.2 3 × 0.2 = 0.6 3² × 0.2 = 1.8 Totals 1.0 E[X] = 1.7 E[X²] = 3.7
Step 1: Calculate E[X]

E[X] = 0×0.1 + 1×0.3 + 2×0.4 + 3×0.2

= 0 + 0.3 + 0.8 + 0.6 = 1.7

Step 2: Calculate E[X²]

E[X²] = 0²×0.1 + 1²×0.3 + 2²×0.4 + 3²×0.2

= 0 + 0.3 + 1.6 + 1.8 = 3.7

Step 3: Calculate variance

Var(X) = E[X²] - (E[X])²

= 3.7 - (1.7)²

= 3.7 - 2.89 = 0.81

Step 4: Calculate standard deviation

SD(X) = √Var(X) = √0.81 = 0.9

Step 5: Verify the probability distribution

Sum of probabilities: 0.1 + 0.3 + 0.4 + 0.2 = 1.0 ✓

Mean
1.7
Variance
0.81
Std Dev
0.9
Var(X) = 0.81, SD(X) = 0.9
Final answer:

The variance of X is 0.81.

The standard deviation of X is 0.9.

Applied rules:

• Variance Formula: Var(X) = E[X²] - (E[X])²

• Standard Deviation: SD(X) = √Var(X)

• Verification: Probabilities must sum to 1

Variance and Standard Deviation: Comprehensive Summary

Complete Summary: Variance and Standard Deviation of Random Variables

Core Concepts

Variance: The average squared deviation from the mean, measuring spread.

Formula: Var(X) = E[(X - μ)²] = E[X²] - (E[X])².

Standard Deviation: σ = √Var(X), in same units as original variable.

Interpretation: Higher values indicate greater dispersion of values.

Key Properties

Non-negativity: Var(X) ≥ 0, with equality only for constants.

Linear Transformation: Var(aX + b) = a²Var(X).

Standard Deviation: SD(aX + b) = |a|SD(X).

Units: Variance in squared units, SD in original units.

Calculation Process

Step 1: Calculate E[X] (the mean).

Step 2: Calculate E[X²] (expected value of squares).

Step 3: Apply variance formula: Var(X) = E[X²] - (E[X])².

Step 4: Calculate SD(X) = √Var(X).

Problem-Solving Tips

Organize Calculations: Use tables to track x, P(X=x), x×P, x²×P.

Check Work: Verify probabilities sum to 1.

Units Matter: Variance has squared units, SD has original units.

Interpretation: SD tells you typical deviation from the mean.

Detailed Definitions:

Variance: A measure of how far a set of numbers is spread out from their average value. It's the expectation of the squared deviation of a random variable from its mean.

Standard Deviation: The square root of variance, providing a measure of dispersion that is in the same units as the original data. It represents the average distance of data points from the mean.

Dispersion: The degree to which data is spread out or scattered around the central tendency.

Deviation: The difference between an observed value and the expected value (mean).

Squared Deviation: The square of the deviation, ensuring all values are positive and emphasizing larger deviations.

Systematic Calculation Method:
  1. Verify Distribution: Ensure all probabilities sum to 1.
  2. Calculate Mean: E[X] = Σ [x × P(X = x)].
  3. Calculate E[X²]: Σ [x² × P(X = x)].
  4. Apply Formula: Var(X) = E[X²] - (E[X])².
  5. Calculate SD: SD(X) = √Var(X).
  6. Interpret Results: Explain in context of the problem.
Memory Tip: Variance = "How spread out?" (squared units), SD = "How far from average?" (original units).
Common Mistake: Using (E[X])² instead of E[X²] in the variance formula.
Efficiency Tip: Create a table to organize all calculations systematically.
Application Tip: In finance, SD measures investment risk; in quality control, it measures consistency.
Key Applications: Risk assessment, quality control, performance evaluation, statistical inference.
Relationship to Normal Distribution: About 68% of values within 1 SD of mean, 95% within 2 SDs.
Critical Formulas to Remember:

• Variance Formula: Var(X) = E[X²] - (E[X])²

• Standard Deviation: SD(X) = √Var(X)

• Linear Transformation: Var(aX + b) = a²Var(X)

• Constant: Var(c) = 0

Questions & Answers

Question: Why do we square the deviations when calculating variance? Why not just use absolute values?

Answer: Great question! Squaring deviations serves several important purposes:

Mathematical Advantages:

  • Squaring ensures all deviations are positive (no cancellation)
  • Creates a smooth, differentiable function (important for calculus-based statistics)
  • Emphasizes larger deviations more than smaller ones (quadratic effect)

Why not absolute values? We could use absolute deviations (mean absolute deviation), but variance has superior mathematical properties:

  • Variance leads to the normal distribution in the Central Limit Theorem
  • More amenable to mathematical analysis and optimization
  • Preserves important relationships like Var(X+Y) = Var(X) + Var(Y) for independent variables

The standard deviation (square root of variance) brings us back to original units while preserving these mathematical advantages.

Question: In Exercise 2, Investment B had a lower expected return but higher standard deviation. What does this mean for an investor?

Answer: This represents a classic risk-return tradeoff:

Investment A: Higher expected return (10% vs 9.2%) with lower risk (SD = 3.87%)

Investment B: Lower expected return but potentially higher upside with higher risk (SD = 5.88%)

Investor Implications:

  • Risk-Averse Investor: Would prefer Investment A (higher return with less risk)
  • Risk-Tolerant Investor: Might accept Investment B for potential higher returns
  • Efficient Market Theory: Generally, higher risk should correspond to higher expected return

In this case, Investment B offers less reward per unit of risk (lower Sharpe ratio), making Investment A more attractive from a risk-adjusted perspective.

Question: Why does Var(aX + b) = a²Var(X)? Why is the constant b eliminated and why is a squared?

Answer: Let's prove this property step by step:

Definition: Var(Y) = E[(Y - E[Y])²]

Let Y = aX + b, then:

E[Y] = E[aX + b] = aE[X] + b

Now, Y - E[Y] = (aX + b) - (aE[X] + b) = aX + b - aE[X] - b = a(X - E[X])

Therefore: Var(Y) = E[(Y - E[Y])²] = E[a²(X - E[X])²] = a²E[(X - E[X])²] = a²Var(X)

Intuition:

  • Adding constant b: Shifts all values by the same amount, so relative distances (variance) remain unchanged
  • Multiplying by a: Stretches/shrinks distances from the mean by factor a, but since variance uses squared distances, the effect is a²

This property shows that variance measures spread around the mean, unaffected by location shifts but sensitive to scale changes.