Solved Exercises on Variance and Standard Deviation of Random Variables

Master variance and standard deviation: discrete, continuous, properties, and applications through these 5 detailed exercises.

Solution: Exercises 1 to 3
1 Discrete Variance and Standard Deviation
Exercise 1
A discrete random variable X has the probability distribution: P(X=1)=0.2, P(X=2)=0.3, P(X=3)=0.4, P(X=4)=0.1. Find Var(X) and SD(X).
Definition:

Variance: Measures the spread of a distribution. Var(X) = E[(X - E[X])²] = E[X²] - (E[X])². Standard Deviation: σ = √Var(X).

Variance calculation method:
  1. Calculate E[X] = Σx·P(X = x)
  2. Calculate E[X²] = Σx²·P(X = x)
  3. Apply the variance formula: Var(X) = E[X²] - (E[X])²
  4. Calculate SD(X) = √Var(X)
E[X]
2.4
E[X²]
6.6
Var(X)
6.6-2.4²
SD(X)
√0.84
Step 1: Calculate E[X]

E[X] = (1)(0.2) + (2)(0.3) + (3)(0.4) + (4)(0.1) = 0.2 + 0.6 + 1.2 + 0.4 = 2.4

Step 2: Calculate E[X²]

E[X²] = (1²)(0.2) + (2²)(0.3) + (3²)(0.4) + (4²)(0.1) = (1)(0.2) + (4)(0.3) + (9)(0.4) + (16)(0.1) = 0.2 + 1.2 + 3.6 + 1.6 = 6.6

Step 3: Calculate variance

Var(X) = E[X²] - (E[X])² = 6.6 - (2.4)² = 6.6 - 5.76 = 0.84

Step 4: Calculate standard deviation

SD(X) = √Var(X) = √0.84 ≈ 0.9165

Var(X) = 0.84, SD(X) ≈ 0.9165
Final answer:

Var(X) = 0.84 and SD(X) ≈ 0.9165.

Applied rules:

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

• Standard deviation: σ = √Var(X)

• Computational efficiency: Using the alternative variance formula

2 Continuous Variance
Exercise 2
A continuous random variable X has probability density function f(x) = 2x for 0 ≤ x ≤ 1, and 0 otherwise. Find Var(X).
Definition:

Continuous Variance: For a continuous random variable, Var(X) = ∫(x - E[X])²f(x)dx = E[X²] - (E[X])², where E[X] = ∫xf(x)dx and E[X²] = ∫x²f(x)dx.

E[X]
∫₀¹ x·2x dx
E[X²]
∫₀¹ x²·2x dx
Var(X)
E[X²]-(E[X])²
Result
1/18
Step 1: Calculate E[X]

E[X] = ∫₀¹ x·2x dx = ∫₀¹ 2x² dx = [2x³/3]₀¹ = (2/3)(1) - (2/3)(0) = 2/3

Step 2: Calculate E[X²]

E[X²] = ∫₀¹ x²·2x dx = ∫₀¹ 2x³ dx = [2x⁴/4]₀¹ = (1/2)(1) - (1/2)(0) = 1/2

Step 3: Calculate variance

Var(X) = E[X²] - (E[X])² = 1/2 - (2/3)² = 1/2 - 4/9 = 9/18 - 8/18 = 1/18

Var(X) = 1/18
Final answer:

Var(X) = 1/18 and SD(X) = √(1/18) ≈ 0.2357.

Applied rules:

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

• Integration: Apply power rule for polynomials

• Domain: Integrate only over where f(x) > 0

3 Variance Properties
Exercise 3
If Var(X) = 5, find Var(3X + 2) and SD(3X + 2).
Definition:

Variance Properties: For constants a and b: Var(aX + b) = a²Var(X). The constant b does not affect variance. SD(aX + b) = |a|SD(X).

Given
Var(X)=5
Property
Var(aX+b)=a²Var(X)
For 3X+2
a=3, b=2
Result
9×5=45
Step 1: Apply the variance property

For any constants a and b: Var(aX + b) = a²Var(X). The constant b shifts the distribution but doesn't affect spread.

Step 2: Identify the constants

For 3X + 2: a = 3 and b = 2.

Step 3: Calculate Var(3X + 2)

Var(3X + 2) = 3²Var(X) = 9 × 5 = 45

Step 4: Calculate SD(3X + 2)

SD(3X + 2) = √Var(3X + 2) = √45 = 3√5 ≈ 6.708

Var(3X + 2) = 45, SD(3X + 2) = 3√5
Final answer:

Var(3X + 2) = 45 and SD(3X + 2) = 3√5 ≈ 6.708.

Applied rules:

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

• Constant shift: Adding a constant doesn't change variance

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

Rules and methods, laws,...
\(\text{Var}(X) = E[(X - E[X])^2] = E[X^2] - (E[X])^2\)
Variance Formula
Variance
Var(X) = E[X²] - (E[X])²
Spread measure
SD
SD(X) = √Var(X)
Units preserved
Scaling
Var(aX+b) = a²Var(X)
Linear transformations
Sum
Var(X+Y) = Var(X) + Var(Y)
If independent
Key definitions:

Variance: A measure of how spread out the values of a random variable are from the mean. Var(X) = E[(X - E[X])²].

Standard Deviation: The square root of variance, giving the average deviation from the mean in the same units as the random variable.

Discrete Variance: Var(X) = Σ(x - μ)²·P(X = x) where μ = E[X].

Continuous Variance: Var(X) = ∫(x - μ)²f(x)dx where μ = E[X] and f(x) is the PDF.

Alternative Formula: Var(X) = E[X²] - (E[X])², often computationally more efficient.

Complete methodology:
  1. Calculate E[X]: Find the expected value
  2. Calculate E[X²]: Find the expected value of X²
  3. Apply variance formula: Var(X) = E[X²] - (E[X])²
  4. Find standard deviation: SD(X) = √Var(X)
  5. Apply properties: Use scaling properties when applicable
  6. Interpret results: Understand practical significance
Tip 1: Use Var(X) = E[X²] - (E[X])² for computational efficiency.
Tip 2: Adding a constant doesn't change variance: Var(X + c) = Var(X).
Tip 3: Multiplying by a constant scales variance by the square: Var(cX) = c²Var(X).
Tip 4: Standard deviation is in the same units as the original variable.
Common errors: Forgetting to square the constant when scaling, misapplying variance properties, miscalculating expected values.
Key insight: Variance measures the average squared deviation from the mean.
Essential formulas:

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

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

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

• Sum (independent): Var(X + Y) = Var(X) + Var(Y)

• Discrete: Var(X) = Σ(x - μ)²·P(X = x)

• Continuous: Var(X) = ∫(x - μ)²f(x)dx

Solution: Exercises 4 to 5
4 Binomial Variance
Exercise 4
A fair coin is flipped 10 times. Let X be the number of heads. Find Var(X) and SD(X).
Definition:

Binomial Distribution: X ~ B(n,p) where n is the number of trials and p is the probability of success. For binomial: E[X] = np and Var(X) = np(1-p).

Parameters
n=10, p=0.5
Formula
Var(X)=np(1-p)
Calculation
10×0.5×0.5
Result
2.5
Step 1: Identify the distribution

Flipping a fair coin 10 times follows a binomial distribution: X ~ B(10, 0.5).

Step 2: Apply the binomial variance formula

For X ~ B(n,p): Var(X) = np(1-p) = 10 × (0.5) × (1-0.5) = 10 × 0.5 × 0.5 = 2.5

Step 3: Calculate standard deviation

SD(X) = √Var(X) = √2.5 ≈ 1.581

Var(X) = 2.5, SD(X) ≈ 1.581
Final answer:

Var(X) = 2.5 and SD(X) ≈ 1.581.

Applied rules:

• Binomial variance: Var(X) = np(1-p)

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

• Known distribution: Use specialized formulas when available

5 Independent Random Variables
Exercise 5
Let X and Y be independent random variables with Var(X) = 4 and Var(Y) = 9. Find Var(2X - 3Y + 5).
Definition:

Independent Random Variables: If X and Y are independent, then Var(X + Y) = Var(X) + Var(Y). For linear combinations: Var(aX + bY + c) = a²Var(X) + b²Var(Y).

Given
Var(X)=4, Var(Y)=9
Property
Var(aX+bY+c)=a²Var(X)+b²Var(Y)
For 2X-3Y+5
a=2, b=-3, c=5
Result
4×4+9×9=97
Step 1: Apply the property for independent variables

For independent X and Y: Var(aX + bY + c) = a²Var(X) + b²Var(Y). The constant c doesn't affect variance.

Step 2: Identify the coefficients

For 2X - 3Y + 5: a = 2, b = -3, and c = 5.

Step 3: Calculate the variance

Var(2X - 3Y + 5) = (2)²Var(X) + (-3)²Var(Y) = 4×4 + 9×9 = 16 + 81 = 97

Var(2X - 3Y + 5) = 97
Final answer:

Var(2X - 3Y + 5) = 97.

Applied rules:

• Independence property: Var(X + Y) = Var(X) + Var(Y) for independent variables

• Linear combination: Var(aX + bY + c) = a²Var(X) + b²Var(Y)

• Constant addition: Adding a constant doesn't change variance

Comprehensive Summary: Variance and Standard Deviation of Random Variables
\(\text{Var}(X) = E[(X - E[X])^2] = E[X^2] - (E[X])^2\)
Variance Formula
Key definitions:

Variance: A measure of how spread out the values of a random variable are from the mean. It quantifies the dispersion of the distribution.

Standard Deviation: The square root of variance, providing the average deviation from the mean in the same units as the random variable.

Discrete Variance: Var(X) = Σ(x - μ)²·P(X = x) where μ = E[X].

Continuous Variance: Var(X) = ∫(x - μ)²f(x)dx where μ = E[X] and f(x) is the PDF.

Alternative Formula: Var(X) = E[X²] - (E[X])², often computationally more efficient.

Properties: Var(aX + b) = a²Var(X) for constants a and b.

Complete methodology:
  1. Calculate E[X]: Find the expected value of the random variable
  2. Calculate E[X²]: Find the expected value of X²
  3. Apply variance formula: Use Var(X) = E[X²] - (E[X])²
  4. Find standard deviation: Calculate SD(X) = √Var(X)
  5. Apply properties: Use scaling and transformation properties when applicable
  6. Interpret results: Understand the practical significance of the measures
Tip 1: Use Var(X) = E[X²] - (E[X])² for computational efficiency.
Tip 2: Adding a constant doesn't change variance: Var(X + c) = Var(X).
Tip 3: Multiplying by a constant scales variance by the square: Var(cX) = c²Var(X).
Tip 4: Standard deviation is in the same units as the original variable.
Tip 5: For independent variables: Var(X + Y) = Var(X) + Var(Y).
Common errors: Forgetting to square the constant when scaling, misapplying variance properties, confusing variance with standard deviation, miscalculating expected values.
Memorization aid: "Variance measures spread, Standard deviation preserves units".
Advanced insight: Variance is the second central moment of a distribution and forms the basis for higher moments.
Essential formulas and properties:

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

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

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

• Sum (independent): Var(X + Y) = Var(X) + Var(Y)

• Linear combination (independent): Var(aX + bY + c) = a²Var(X) + b²Var(Y)

• Discrete: Var(X) = Σ(x - μ)²·P(X = x)

• Continuous: Var(X) = ∫(x - μ)²f(x)dx

• Binomial: Var(X) = np(1-p) for X ~ B(n,p)

• Geometric: Var(X) = (1-p)/p² for X ~ Geo(p)

Example progression (Simple to Complex):

• Simple: Fair die roll (variance calculation)

• Intermediate: Given probability distribution

• Advanced: Continuous probability density function

• Complex: Linear combinations of random variables

Key takeaways for memorization:

• Variance measures how spread out values are from the mean

• Standard deviation is in the same units as the original variable

• Var(aX + b) = a²Var(X) - constant doesn't affect variance

• Use E[X²] - (E[X])² for computational efficiency

• For independent variables, variances add: Var(X + Y) = Var(X) + Var(Y)

Questions & Answers

Question: Why do we square the deviations in variance calculation instead of using absolute values?

Answer: Squaring the deviations provides several advantages:

  • Mathematical convenience: Squares are differentiable, making optimization easier
  • Penalizing outliers: Larger deviations are penalized more heavily
  • Algebraic properties: Leads to nice properties like Var(X + Y) = Var(X) + Var(Y) for independent variables
  • Connection to normal distribution: Many statistical methods assume normality, which is naturally expressed in terms of squared deviations

While absolute deviations would work, squaring leads to more elegant mathematical properties.

Question: Why does adding a constant not change the variance?

Answer: Adding a constant shifts the entire distribution by the same amount, but doesn't change the spread:

  • Visual analogy: Imagine moving a seesaw - the balance point changes, but the distances from the center stay the same
  • Mathematical reason: Var(X + c) = E[(X + c - E[X + c])²] = E[(X + c - (E[X] + c))²] = E[(X - E[X])²] = Var(X)
  • Practical example: If everyone in a class scores 5 points higher, the average changes but the spread of scores stays the same

Variance measures spread, not location.

Question: When do we add variances of independent random variables versus when we don't?

Answer: Var(X + Y) = Var(X) + Var(Y) holds only when X and Y are independent (or uncorrelated):

  • Independent variables: Var(X + Y) = Var(X) + Var(Y)
  • Dependent variables: Var(X + Y) = Var(X) + Var(Y) + 2Cov(X,Y)
  • General rule: Var(aX + bY) = a²Var(X) + b²Var(Y) + 2abCov(X,Y)

The independence assumption is crucial for the simple addition formula. If variables are correlated, you must account for their covariance.