Solved Exercises on Expected Value (Mean) of a Random Variable

Master expected value: discrete, continuous, properties, and applications through these 5 detailed exercises.

Solution: Exercises 1 to 3
1 Discrete Expected Value
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 E[X].
Definition:

Expected Value: The weighted average of all possible values of a random variable, where each value is weighted by its probability. For discrete variables: E[X] = Σx·P(X = x).

Expected value calculation method:
  1. Multiply each possible value by its probability
  2. Sum all the products
  3. Verify the calculation
Values
1, 2, 3, 4
Probabilities
0.2, 0.3, 0.4, 0.1
Products
0.2, 0.6, 1.2, 0.4
Sum
2.4
Step 1: Apply the expected value formula

E[X] = Σx·P(X = x) = (1)(0.2) + (2)(0.3) + (3)(0.4) + (4)(0.1)

Step 2: Calculate each product

(1)(0.2) = 0.2, (2)(0.3) = 0.6, (3)(0.4) = 1.2, (4)(0.1) = 0.4

Step 3: Sum the products

E[X] = 0.2 + 0.6 + 1.2 + 0.4 = 2.4

E[X] = 2.4
Final answer:

E[X] = 2.4. The expected value of X is 2.4.

Applied rules:

• Expected value formula: E[X] = Σx·P(X = x)

• Weighted average: Each value weighted by its probability

• Linearity: Sum of weighted values

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

Continuous Expected Value: For a continuous random variable with probability density function f(x), the expected value is E[X] = ∫xf(x)dx over the domain of X.

Integral setup
∫₀¹ x·2x dx
Simplified
∫₀¹ 2x² dx
Antiderivative
(2/3)x³
Result
2/3
Step 1: Set up the integral

E[X] = ∫xf(x)dx = ∫₀¹ x·2x dx = ∫₀¹ 2x² dx

Step 2: Integrate

∫ 2x² dx = (2/3)x³ + C

Step 3: Evaluate the definite integral

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

E[X] = 2/3
Final answer:

E[X] = 2/3. The expected value of X is 2/3.

Applied rules:

• Continuous expected value: E[X] = ∫xf(x)dx

• Integration: Apply power rule for polynomials

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

3 Expected Value of a Function
Exercise 3
Using the distribution from Exercise 1, find E[X²] and E[2X + 3].
Definition:

Expected Value of a Function: For g(X), E[g(X)] = Σg(x)·P(X = x) for discrete variables, or E[g(X)] = ∫g(x)f(x)dx for continuous variables.

E[X²]
Σx²·P(X=x)
Calculation
1²×0.2+2²×0.3+3²×0.4+4²×0.1
E[2X+3]
2E[X]+3
Results
6.4, 7.8
Step 1: Calculate E[X²]

E[X²] = Σx²·P(X = 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 2: Calculate E[2X + 3] using linearity

Using the linearity property: E[2X + 3] = 2E[X] + 3 = 2(2.4) + 3 = 4.8 + 3 = 7.8

Step 3: Verify with direct calculation

E[2X + 3] = Σ(2x + 3)·P(X = x) = (5)(0.2) + (7)(0.3) + (9)(0.4) + (11)(0.1) = 1.0 + 2.1 + 3.6 + 1.1 = 7.8 ✓

E[X²] = 6.6, E[2X + 3] = 7.8
Final answer:

E[X²] = 6.6 and E[2X + 3] = 7.8.

Applied rules:

• Function of random variable: E[g(X)] = Σg(x)·P(X = x)

• Linearity of expectation: E[aX + b] = aE[X] + b

• Computational efficiency: Linearity property simplifies calculations

Rules and methods, laws,...
\(E[X] = \sum x \cdot P(X = x) \quad \text{or} \quad E[X] = \int x \cdot f(x) dx\)
Expected Value Formulas
Discrete
E[X] = Σx·P(X = x)
Weighted average
Continuous
E[X] = ∫x·f(x)dx
Integral average
Linearity
E[aX + b] = aE[X] + b
Linear transformations
Function
E[g(X)] = Σg(x)·P(X = x)
Non-linear transformations
Key definitions:

Expected Value (Mean): The long-run average value of repetitions of an experiment it represents.

Discrete Expected Value: E[X] = Σx·P(X = x), where the sum is taken over all possible values of X.

Continuous Expected Value: E[X] = ∫xf(x)dx, where f(x) is the probability density function.

Linearity of Expectation: E[aX + b] = aE[X] + b for constants a and b.

Law of the Unconscious Statistician: Method for finding expected value of functions of random variables.

Complete methodology:
  1. Identify the type: Determine if discrete or continuous
  2. Verify distribution: Ensure probabilities/ densities are valid
  3. Select formula: Use appropriate expected value formula
  4. Perform calculation: Apply summation or integration
  5. Verify result: Check if the result makes sense
  6. Interpret meaning: Understand practical significance
Tip 1: Expected value may not be a possible value of the random variable.
Tip 2: Use linearity property E[aX + b] = aE[X] + b for efficiency.
Tip 3: For continuous variables, integrate only over the support of f(x).
Tip 4: Expected value represents the center of the probability distribution.
Common errors: Forgetting to multiply by probability/density, integrating over wrong limits, misapplying linearity.
Key insight: Expected value is the theoretical average over infinitely many trials.
Essential formulas:

• Discrete: E[X] = Σx·P(X = x)

• Continuous: E[X] = ∫xf(x)dx

• Linearity: E[aX + b] = aE[X] + b

• Function: E[g(X)] = Σg(x)·P(X = x) or ∫g(x)f(x)dx

• Additivity: E[X + Y] = E[X] + E[Y] (regardless of independence)

Solution: Exercises 4 to 5
4 Variance from Expected Value
Exercise 4
Using the distribution from Exercise 1, find Var(X) and the standard deviation of X.
Definition:

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

From prev
E[X]=2.4
Calculated
E[X²]=6.6
Variance
E[X²]-(E[X])²
SD
√Var(X)
Step 1: Recall previous results

From Exercise 3: E[X] = 2.4 and E[X²] = 6.6.

Step 2: Calculate variance

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

Step 3: Calculate standard deviation

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

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

Var(X) = 0.84 and the standard deviation is approximately 0.9165.

Applied rules:

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

• Standard deviation: σ = √Var(X)

• Computational efficiency: Using the alternative variance formula

5 Expected Value of a Game
Exercise 5
A game costs $5 to play. You roll a fair die: if you roll 6, you win $20; if you roll 5, you win $10; otherwise you win nothing. What is the expected value of playing this game?
Definition:

Expected Value of a Game: The average net gain or loss per game over many plays. Calculate net winnings for each outcome, multiply by probability, and sum.

Roll 6
$20-$5=$15
Roll 5
$10-$5=$5
Roll 1-4
$0-$5=-$5
E[Net]
(15)(1/6)+(5)(1/6)+(-5)(4/6)
Step 1: Define net winnings

Roll 6: Win $20, pay $5 → Net gain = $15. Roll 5: Win $10, pay $5 → Net gain = $5. Roll 1-4: Win $0, pay $5 → Net loss = -$5.

Step 2: Assign probabilities

P(Roll 6) = 1/6, P(Roll 5) = 1/6, P(Roll 1-4) = 4/6.

Step 3: Calculate expected net value

E[Net] = ($15)(1/6) + ($5)(1/6) + (-$5)(4/6) = $15/6 + $5/6 - $20/6 = $0/6 = $0.

E[Net] = $0
Final answer:

The expected value of playing this game is $0. This is a fair game where you expect to break even in the long run.

Applied rules:

• Net calculation: Include all costs and gains

• Expected value: Weighted average of all outcomes

• Game fairness: Expected value of $0 indicates a fair game

Comprehensive Summary: Expected Value (Mean) of a Random Variable
\(E[X] = \sum x \cdot P(X = x) \quad \text{or} \quad E[X] = \int x \cdot f(x) dx\)
Expected Value Formulas
Key definitions:

Expected Value (Mean): The long-run average value of repetitions of an experiment it represents. It's the weighted average of all possible values of a random variable.

Discrete Expected Value: E[X] = Σx·P(X = x), where the sum is taken over all possible values of X.

Continuous Expected Value: E[X] = ∫xf(x)dx, where f(x) is the probability density function.

Linearity of Expectation: E[aX + b] = aE[X] + b for constants a and b.

Variance: Var(X) = E[X²] - (E[X])², measures the spread of the distribution.

Standard Deviation: σ = √Var(X), measures the average deviation from the mean.

Complete methodology:
  1. Identify the variable type: Determine if discrete or continuous
  2. Verify distribution: Ensure probabilities/densities are valid
  3. Select appropriate formula: Use discrete or continuous formula
  4. Perform calculations: Apply summation or integration
  5. Apply properties: Use linearity or other properties when helpful
  6. Interpret results: Understand practical significance
Tip 1: Expected value may not be a possible value of the random variable.
Tip 2: Use linearity property E[aX + b] = aE[X] + b for efficiency.
Tip 3: For continuous variables, integrate only over the support of f(x).
Tip 4: Expected value represents the center of the probability distribution.
Tip 5: Variance measures how spread out values are from the expected value.
Common errors: Forgetting to multiply by probability/density, integrating over wrong limits, misapplying linearity, confusing expected value with most likely value.
Memorization aid: "Expected value = Weighted average of all possible values".
Advanced insight: Expected value is the first moment of a distribution and forms the basis for higher moments.
Essential formulas and properties:

• Discrete: E[X] = Σx·P(X = x)

• Continuous: E[X] = ∫xf(x)dx

• Linearity: E[aX + b] = aE[X] + b

• Function: E[g(X)] = Σg(x)·P(X = x) or ∫g(x)f(x)dx

• Additivity: E[X + Y] = E[X] + E[Y] (regardless of independence)

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

• Standard deviation: σ = √Var(X)

Example progression (Simple to Complex):

• Simple: Fair die roll (E[X] = 3.5)

• Intermediate: Given probability distribution

• Advanced: Continuous probability density function

• Complex: Functions of random variables and games

Key takeaways for memorization:

• Expected value is the theoretical average over many trials

• It may not be a possible outcome of the random variable

• Linearity property: E[aX + b] = aE[X] + b

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

• Expected value represents the center of the distribution

Questions & Answers

Question: Is the expected value always one of the possible outcomes of the random variable?

Answer: No, the expected value does not need to be a possible outcome! For example:

  • Rolling a fair die: E[X] = 3.5, but you can never roll 3.5
  • Flipping a coin (0 = tails, 1 = heads): E[X] = 0.5, but you never get 0.5

The expected value is the long-run average, not the most likely outcome.

Question: Why do we use the formula Var(X) = E[X²] - (E[X])² instead of the definition?

Answer: The computational formula Var(X) = E[X²] - (E[X])² is more convenient because:

  • It's easier to calculate than E[(X - E[X])²]
  • It requires only E[X] and E[X²], both of which are often already calculated
  • It avoids computing (X - E[X])² for each value

Both formulas are mathematically equivalent, but the computational version is more efficient.

Question: Does E[X + Y] = E[X] + E[Y] always hold, even if X and Y are dependent?

Answer: Yes! The linearity of expectation is remarkable because E[X + Y] = E[X] + E[Y] holds regardless of whether X and Y are independent or dependent.

  • This is one of the most important properties of expected value
  • It extends to any finite sum: E[X₁ + X₂ + ... + Xₙ] = E[X₁] + E[X₂] + ... + E[Xₙ]
  • Independence is only required for E[XY] = E[X]E[Y]

This property makes expected value calculations much more manageable in complex scenarios.