Solved Exercises on Random Variables Introduction

Master random variables: discrete vs continuous, probability distributions, expected value calculations through these 5 detailed exercises.

Solution: Exercises 1 to 3
1 Discrete Random Variable
Exercise 1
A fair six-sided die is rolled. Let X be the number shown on the die. Find the probability distribution of X and calculate P(X ≤ 3).
Definition:

Discrete Random Variable: Takes on a countable number of distinct values. Each outcome has a specific probability.

Probability Distribution: Lists all possible values of X and their corresponding probabilities.

Method for discrete RV:
  1. List all possible outcomes
  2. Assign probabilities to each outcome
  3. Verify probabilities sum to 1
  4. Calculate desired probabilities
X (value) P(X = x) 1 1/6 2 1/6 3 1/6 4 1/6 5 1/6 6 1/6
Step 1: Identify the sample space

Rolling a die: {1, 2, 3, 4, 5, 6}

X can take values: 1, 2, 3, 4, 5, 6

Step 2: Assign equal probabilities

Since die is fair, each outcome has probability 1/6

P(X = 1) = P(X = 2) = ... = P(X = 6) = 1/6

Step 3: Calculate P(X ≤ 3)

P(X ≤ 3) = P(X = 1) + P(X = 2) + P(X = 3)

= 1/6 + 1/6 + 1/6 = 3/6 = 1/2

Step 4: Verify sum of probabilities

1/6 + 1/6 + 1/6 + 1/6 + 1/6 + 1/6 = 6/6 = 1 ✓

P(X ≤ 3) = 1/2
Final answer:

The probability distribution is uniform with P(X = x) = 1/6 for x ∈ {1,2,3,4,5,6}

P(X ≤ 3) = 1/2

Applied rules:

• Discrete RV Properties: Sum of all probabilities equals 1

• Addition Rule: P(A ∪ B) = P(A) + P(B) for mutually exclusive events

• Uniform Distribution: All outcomes equally likely

2 Coin Toss Experiment
Exercise 2
Two fair coins are tossed. Let X be the number of heads obtained. Find the probability distribution of X and calculate E[X].
Definition:

Expected Value E[X]: The weighted average of all possible values of X, weighted by their probabilities.

E[X] = Σ [x × P(X = x)]

Sample Space Number of Heads (X) TT 0 HT, TH 1 HH 2
X P(X = x) 0 1/4 1 2/4 = 1/2 2 1/4
Step 1: List all possible outcomes

Sample space: {TT, HT, TH, HH} (4 total outcomes)

Step 2: Count heads for each outcome

TT → 0 heads, HT → 1 head, TH → 1 head, HH → 2 heads

Step 3: Calculate probabilities

P(X = 0) = 1/4 (only TT)

P(X = 1) = 2/4 = 1/2 (HT, TH)

P(X = 2) = 1/4 (only HH)

Step 4: Calculate expected value

E[X] = 0×P(X=0) + 1×P(X=1) + 2×P(X=2)

= 0×(1/4) + 1×(1/2) + 2×(1/4)

= 0 + 1/2 + 1/2 = 1

E[X] = 1
Final answer:

Probability distribution: P(X=0)=1/4, P(X=1)=1/2, P(X=2)=1/4

Expected value: E[X] = 1

Applied rules:

• Counting Principle: Total outcomes = 2^n for n coin tosses

• Expected Value Formula: E[X] = Σ [x × P(X = x)]

• Probability Calculation: Favorable outcomes / Total outcomes

3 Game of Chance
Exercise 3
In a game, you pay $2 to play. You win $5 if you roll a 6 on a fair die, $1 if you roll a 4 or 5, and nothing otherwise. Let X be your net winnings. Find the probability distribution of X and determine if the game is fair.
Definition:

Net Winnings: Amount won minus cost to play

Fair Game: Expected value of net winnings equals zero

Die Roll Winnings Net (X) P(X = x) 6 $5 $3 1/6 4, 5 $1 -$1 2/6 = 1/3 1, 2, 3 $0 -$2 3/6 = 1/2
Step 1: Determine possible outcomes and net winnings

Roll 6: Win $5, Net = $5 - $2 = $3

Roll 4 or 5: Win $1, Net = $1 - $2 = -$1

Roll 1, 2, or 3: Win $0, Net = $0 - $2 = -$2

Step 2: Calculate probabilities

P(X = 3) = P(rolling 6) = 1/6

P(X = -1) = P(rolling 4 or 5) = 2/6 = 1/3

P(X = -2) = P(rolling 1, 2, or 3) = 3/6 = 1/2

Step 3: Calculate expected value

E[X] = 3×(1/6) + (-1)×(1/3) + (-2)×(1/2)

= 1/2 - 1/3 - 1 = 3/6 - 2/6 - 6/6 = -5/6

Step 4: Determine if game is fair

Since E[X] = -5/6 ≠ 0, the game is not fair.

You expect to lose $5/6 ≈ $0.83 per game on average.

E[X] = -$5/6 (unfair game)
Final answer:

Probability distribution: P(X=3)=1/6, P(X=-1)=1/3, P(X=-2)=1/2

Expected value: E[X] = -$5/6, so the game is unfair.

Applied rules:

• Net Winnings: Gross winnings minus cost to play

• Fair Game Condition: E[X] = 0

• Expected Value Interpretation: Long-run average outcome

Random Variables: Core Concepts
E[X] = \sum_{i} x_i \cdot P(X = x_i)
Expected Value Formula
Discrete RV
X ∈ {1, 2, 3...}
Countable values
Continuous RV
X ∈ [a, b]
Uncountable values
Key definitions:

Random Variable (RV): A variable whose value depends on the outcome of a random phenomenon.

Discrete RV: Takes on a finite or countably infinite number of values.

Continuous RV: Takes on values in an interval of real numbers.

Probability Distribution: Shows all possible values and their probabilities.

Properties of Probability Distribution: 1) 0 ≤ P(X=x) ≤ 1 for all x, 2) Σ P(X=x) = 1
Expected Value Properties: E[aX + b] = aE[X] + b, where a and b are constants.
Tip 1: Always verify that probabilities sum to 1 in discrete distributions.
Tip 2: Expected value represents the long-run average if the experiment is repeated many times.
Tip 3: For games of chance, E[X] > 0 means favorable to player, E[X] < 0 means unfavorable.
Essential formulas:

• Expected Value: E[X] = Σ [x × P(X = x)]

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

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

• Standard Deviation: σ = √Var(X)

Solution: Exercises 4 to 5
4 Probability Distribution Verification
Exercise 4
Given the probability distribution: P(X=1)=0.2, P(X=2)=0.3, P(X=3)=0.4, P(X=4)=0.1. Verify it's a valid distribution and find P(X≥2) and E[X].
Definition:

Valid Probability Distribution: Must satisfy: 1) All probabilities ≥ 0, 2) Sum of all probabilities = 1

X P(X = x) 1 0.2 2 0.3 3 0.4 4 0.1
Step 1: Verify validity conditions

All probabilities ≥ 0: ✓ (0.2, 0.3, 0.4, 0.1 are all positive)

Sum = 0.2 + 0.3 + 0.4 + 0.1 = 1.0 ✓

Step 2: Calculate P(X ≥ 2)

P(X ≥ 2) = P(X = 2) + P(X = 3) + P(X = 4)

= 0.3 + 0.4 + 0.1 = 0.8

Step 3: Calculate expected value

E[X] = 1×P(X=1) + 2×P(X=2) + 3×P(X=3) + 4×P(X=4)

= 1×0.2 + 2×0.3 + 3×0.4 + 4×0.1

= 0.2 + 0.6 + 1.2 + 0.4 = 2.4

Step 4: Interpret results

If this experiment were repeated many times, the average value would be 2.4

P(X ≥ 2) = 0.8, E[X] = 2.4
Final answer:

This is a valid probability distribution since all probabilities are non-negative and sum to 1.

P(X ≥ 2) = 0.8 and E[X] = 2.4

Applied rules:

• Validation Check: All P(X=x) ≥ 0 and Σ P(X=x) = 1

• Complement Rule: P(X ≥ a) = 1 - P(X < a)

• Expected Value Formula: Weighted average of outcomes

5 Linear Transformation
Exercise 5
Let X be a random variable with E[X] = 4 and Var(X) = 9. If Y = 2X - 3, find E[Y] and Var(Y).
Definition:

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

Linear Transformation: If Y = aX + b, then E[Y] = aE[X] + b and Var(Y) = a²Var(X)

Step 1: Identify transformation parameters

Y = 2X - 3, so a = 2 and b = -3

Given: E[X] = 4, Var(X) = 9

Step 2: Calculate E[Y]

Using the rule E[aX + b] = aE[X] + b

E[Y] = E[2X - 3] = 2E[X] - 3 = 2(4) - 3 = 8 - 3 = 5

Step 3: Calculate Var(Y)

Using the rule Var(aX + b) = a²Var(X)

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

Step 4: Calculate standard deviation of Y

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

Step 5: Verify with alternative calculation

For verification: E[Y²] = E[(2X-3)²] = E[4X² - 12X + 9]

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

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

So E[Y²] = 4(25) - 12(4) + 9 = 100 - 48 + 9 = 61

Var(Y) = E[Y²] - (E[Y])² = 61 - 25 = 36 ✓

E[Y] = 5, Var(Y) = 36
Final answer:

For Y = 2X - 3: E[Y] = 5 and Var(Y) = 36

The expected value is transformed linearly while variance is scaled by the square of the coefficient.

Applied rules:

• Linear Transformation of Expectation: E[aX + b] = aE[X] + b

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

• Constant Addition: Doesn't affect variance, only shifts mean

Random Variables: Laws, Methods, and Key Concepts
E[aX + b] = aE[X] + b
Linear Transformation Rule
Key definitions:

Random Variable: A function that assigns a numerical value to each outcome in a sample space.

Discrete RV: Takes on isolated, countable values (like number of heads).

Continuous RV: Takes on values in a continuous range (like height, weight).

Probability Mass Function (PMF): Function giving probability for each value of discrete RV.

Cumulative Distribution Function (CDF): F(x) = P(X ≤ x).

Complete methodology:
  1. Identify the RV: Determine what quantity is being measured.
  2. Classify the RV: Is it discrete or continuous?
  3. Determine possible values: What values can X take?
  4. Find probabilities: Calculate P(X = x) for each possible x.
  5. Verify distribution: Check that probabilities sum to 1.
  6. Calculate measures: Find expected value, variance, etc.
Tip 1: Always check that Σ P(X = x) = 1 for discrete distributions.
Tip 2: Expected value is the theoretical average over many trials.
Tip 3: Adding a constant shifts the mean but doesn't change variance.
Tip 4: Multiplying by a constant scales both mean and variance (variance by square of constant).
Common errors: Forgetting to account for all possible outcomes, miscalculating expected value, confusing variance and standard deviation.
Exam preparation: Practice identifying discrete vs continuous RVs, memorize transformation rules, work on probability calculations.
Formulas to know by heart:

• Expected Value: E[X] = Σ [x × P(X = x)]

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

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

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

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

Questions & Answers

Question: I'm confused about the difference between discrete and continuous random variables. Can you explain with examples?

Answer: Great question! The key difference lies in the number of possible values:

  • Discrete RV: Takes on a countable number of distinct values. Think of counting things.
  • Continuous RV: Takes on values in an interval of real numbers. Think of measuring things.

Examples of Discrete RVs:

  • Number of heads in 10 coin flips (values: 0, 1, 2, ..., 10)
  • Number of students in a class (values: 1, 2, 3, ...)
  • Sum of two dice rolls (values: 2, 3, 4, ..., 12)

Examples of Continuous RVs:

  • Height of a randomly selected person (can be any value in range)
  • Time taken to run a race (can be 10.5 seconds, 10.51 seconds, etc.)
  • Temperature measurement (continuous scale)

The distinction is important because discrete and continuous RVs require different mathematical approaches for probability calculations.

Question: What does the expected value actually represent? Is it the value I'll get if I do the experiment once?

Answer: This is a common misconception! The expected value is NOT the value you'll get from a single trial.

Expected value represents: The long-run average value if you repeat the experiment many times.

Example: In rolling a fair die, E[X] = 3.5. But you'll never actually roll a 3.5! However, if you roll the die many times and average the results, you'll approach 3.5.

Think of it as: A theoretical average, not a prediction for a single outcome.

Practical interpretation: If you play a game many times, your average winnings per game will approach the expected value.

The expected value is a measure of the "center" of the probability distribution, similar to the mean in descriptive statistics.

Question: Why do we use variance instead of just looking at the range of possible values to measure spread?

Answer: Variance provides more comprehensive information than just the range:

  • Range only considers extremes: It only looks at minimum and maximum values, ignoring everything in between.
  • Variance considers all values: It weights each possible value by its probability and measures how far each value is from the mean.
  • Probabilistic weighting: Variance accounts for how likely each value is to occur.

Example: Consider two RVs with same range [0,10] but different distributions:

  • RV A: P(X=0)=0.5, P(X=10)=0.5 (variance = 25)
  • RV B: P(X=5)=1 (variance = 0)

Both have range 10, but RV A has much more variability than RV B. Variance captures this difference.

Variance also has nice mathematical properties that make it useful for further analysis and statistical inference.