Solved Exercises on Introduction to Random Variables

Master random variables: discrete, continuous, probability distributions, and applications through these 5 detailed exercises.

Solution: Exercises 1 to 3
1 Discrete Random Variable
Exercise 1
A fair die is rolled once. Let X be the number of dots showing. Find the probability distribution of X.
Definition:

Discrete Random Variable: A variable that can take on a finite or countably infinite number of distinct values. Each value has a specific probability associated with it.

Probability distribution method:
  1. List all possible values of the random variable
  2. Determine the probability for each value
  3. Verify that probabilities sum to 1
Possible values
X = {1,2,3,4,5,6}
Each probability
P(X=x) = 1/6
Sum of probs
6×(1/6) = 1
Step 1: Identify possible outcomes

When rolling a fair die, the possible outcomes are 1, 2, 3, 4, 5, 6 dots.

Step 2: Determine individual probabilities

Since the die is fair, each outcome has equal probability: P(X = 1) = P(X = 2) = ... = P(X = 6) = 1/6.

Step 3: Verify probability axioms

Check: P(X = 1) + P(X = 2) + ... + P(X = 6) = 1/6 + 1/6 + 1/6 + 1/6 + 1/6 + 1/6 = 6/6 = 1 ✓

P(X = x) = 1/6 for x ∈ {1,2,3,4,5,6}
Final answer:

The probability distribution of X is: P(X = x) = 1/6 for each x in {1, 2, 3, 4, 5, 6}.

Applied rules:

• Probability axioms: Each probability must be between 0 and 1

• Total probability: Sum of all probabilities equals 1

• Discrete variable: Finite number of possible values

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

Expected Value: The long-run average value of a random variable, calculated as E[X] = Σx·P(X = x). It represents the mean outcome over many repetitions of an experiment.

Win outcome
Net gain = $3
Lose outcome
Net loss = -$2
Probabilities
P(win) = 1/6, P(lose) = 5/6
Expected value
E = 3×(1/6) + (-2)×(5/6)
Step 1: Define the net winnings

Roll 6: Win $5, pay $2 → Net gain = $3. Roll anything else: Win $0, pay $2 → Net loss = -$2.

Step 2: Assign probabilities

P(net gain of $3) = P(rolling 6) = 1/6. P(net loss of $2) = P(rolling 1,2,3,4,5) = 5/6.

Step 3: Calculate expected value

E = ($3)(1/6) + (-$2)(5/6) = $3/6 - $10/6 = -$7/6 ≈ -$1.17.

Expected value = -$1.17 per game
Final answer:

The expected value of playing this game is approximately -$1.17 per game. On average, you lose $1.17 per game played.

Applied rules:

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

• Net profit calculation: Include all costs and gains

• Long-term perspective: Expected value predicts average over many trials

3 Continuous Random Variable
Exercise 3
The time (in minutes) that a customer waits in line is uniformly distributed between 0 and 10 minutes. What is the probability that a customer waits between 3 and 7 minutes?
Definition:

Continuous Random Variable: A variable that can take on any value within a specified range or interval. Probabilities are represented by areas under a probability density curve.

Uniform PDF
f(x) = 1/10
Interval length
7 - 3 = 4
Height
1/10
Probability
4×(1/10) = 2/5
Step 1: Identify the distribution

Uniform distribution on [0, 10] means f(x) = 1/(10-0) = 1/10 for 0 ≤ x ≤ 10.

Step 2: Set up the probability calculation

For uniform distribution, P(3 ≤ X ≤ 7) = Area of rectangle = Width × Height.

Step 3: Calculate the area

Width = 7 - 3 = 4 minutes. Height = 1/10. Area = 4 × 1/10 = 4/10 = 2/5.

P(3 ≤ X ≤ 7) = 2/5 = 0.4
Final answer:

The probability that a customer waits between 3 and 7 minutes is 2/5 or 0.4.

Applied rules:

• Continuous probability: P(a ≤ X ≤ b) = Area under PDF curve

• Uniform distribution: Equal probability density over interval

• Area calculation: Rectangle area = base × height

Rules and methods, laws,...
\(E[X] = \sum x \cdot P(X = x) \quad \text{(discrete)}\)
Expected Value Formulas
Discrete RV
X takes finite/countable values
Die rolls, coin flips, counts
Continuous RV
X takes values in intervals
Time, distance, weight
PMF (Discrete)
P(X = x) ≥ 0, ΣP(X = x) = 1
Probability mass function
PDF (Continuous)
f(x) ≥ 0, ∫f(x)dx = 1
Probability density function
Key definitions:

Random Variable: A variable whose possible values depend on the outcome of a random phenomenon.

Discrete Random Variable: Takes on a finite or countably infinite number of distinct values.

Continuous Random Variable: Takes on values in a continuous range or interval.

Probability Distribution: Function that describes the probabilities of all possible outcomes.

Expected Value: The weighted average of all possible values, weighted by their probabilities.

Complete methodology:
  1. Identify the variable: Determine if discrete or continuous
  2. Find possible values: List or define the range of values
  3. Determine probabilities: Calculate probability for each value or range
  4. Verify distribution: Ensure probabilities sum/integrate to 1
  5. Calculate measures: Find expected value, variance, etc.
  6. Interpret results: Understand practical meaning
Tip 1: Discrete variables involve counting (0, 1, 2, ...) while continuous involve measurement (time, distance, weight).
Tip 2: For discrete variables, P(X = x) can be non-zero; for continuous variables, P(X = x) = 0.
Tip 3: Expected value represents the long-term average outcome.
Tip 4: For continuous distributions, probabilities are areas under the PDF curve.
Common errors: Confusing discrete vs continuous, forgetting to normalize probabilities, misinterpreting expected value.
Key insight: Random variables provide a bridge between probability theory and real-world applications.
Essential formulas:

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

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

• Discrete probability axioms: P(X = x) ≥ 0 and ΣP(X = x) = 1

• Continuous probability axioms: f(x) ≥ 0 and ∫f(x)dx = 1

Solution: Exercises 4 to 5
4 Discrete Distribution Properties
Exercise 4
A discrete random variable X has the following probability distribution: P(X=1)=0.2, P(X=2)=0.3, P(X=3)=0.4, P(X=4)=0.1. Find P(X≤3) and E[X].
Definition:

Cumulative Probability: P(X ≤ x) represents the probability that the random variable X takes on a value less than or equal to x. It's the sum of all probabilities up to that value.

P(X≤3)
P(X=1)+P(X=2)+P(X=3)
Calculation
0.2+0.3+0.4=0.9
E[X]
Σx·P(X=x)
Result
2.3
Step 1: Calculate P(X ≤ 3)

P(X ≤ 3) = P(X = 1) + P(X = 2) + P(X = 3) = 0.2 + 0.3 + 0.4 = 0.9.

Step 2: Verify probability distribution

Check: P(X = 1) + P(X = 2) + P(X = 3) + P(X = 4) = 0.2 + 0.3 + 0.4 + 0.1 = 1.0 ✓

Step 3: Calculate expected value

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

P(X ≤ 3) = 0.9, E[X] = 2.4
Final answer:

P(X ≤ 3) = 0.9 and E[X] = 2.4.

Applied rules:

• Cumulative probability: Sum all probabilities up to the value

• Expected value: Weighted average of all possible values

• Distribution verification: All probabilities must sum to 1

5 Mixed Random Variable Scenario
Exercise 5
A factory produces light bulbs. The probability that a bulb is defective is 0.05. In a batch of 10 bulbs, let X be the number of defective bulbs. Find P(X=2) and the expected number of defective bulbs.
Definition:

Binomial Distribution: Models the number of successes in n independent Bernoulli trials, each with probability p of success. X ~ B(n,p) has P(X=k) = C(n,k)p^k(1-p)^(n-k).

Parameters
n=10, p=0.05
P(X=2)
C(10,2)(0.05)²(0.95)⁸
E[X]
n×p=10×0.05
Results
0.0746, 0.5
Step 1: Identify the distribution

Each bulb is independently either defective (success) with probability p = 0.05 or not. X follows a binomial distribution: X ~ B(10, 0.05).

Step 2: Calculate P(X = 2)

P(X = 2) = C(10,2)(0.05)²(0.95)⁸ = 45 × (0.0025) × (0.6634) ≈ 0.0746.

Step 3: Calculate expected value

For binomial distribution: E[X] = np = 10 × 0.05 = 0.5 defective bulbs.

P(X = 2) ≈ 0.0746, E[X] = 0.5
Final answer:

The probability of exactly 2 defective bulbs is approximately 0.0746, and the expected number of defective bulbs is 0.5.

Applied rules:

• Binomial probability: P(X = k) = C(n,k)p^k(1-p)^(n-k)

• Binomial expectation: E[X] = np

• Independence assumption: Each trial is independent

Comprehensive Summary: Introduction to Random Variables
\(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:

Random Variable: A variable whose possible values depend on the outcome of a random phenomenon. It maps outcomes of a random process to numerical values.

Discrete Random Variable: Takes on a finite or countably infinite number of distinct values. Examples include number of heads in coin flips, number of customers arriving at a store.

Continuous Random Variable: Takes on values in a continuous range or interval. Examples include time between arrivals, height of individuals, temperature readings.

Probability Mass Function (PMF): For discrete variables, PMF gives P(X = x) for each possible value x.

Probability Density Function (PDF): For continuous variables, PDF describes the relative likelihood of different values.

Expected Value: The long-run average value of a random variable, representing the center of its distribution.

Complete methodology:
  1. Problem identification: Determine if dealing with discrete or continuous variable
  2. Variable definition: Clearly define what the random variable represents
  3. Parameter determination: Identify distribution type and parameters
  4. Probability calculation: Apply appropriate formulas for the distribution
  5. Measure computation: Calculate expected value, variance, or other measures
  6. Interpretation: Explain results in practical context
Tip 1: Discrete variables involve counting (0, 1, 2, ...) while continuous involve measuring (time, distance, weight).
Tip 2: For discrete variables, P(X = x) can be non-zero; for continuous variables, P(X = x) = 0 for any specific x.
Tip 3: Expected value represents the theoretical average over infinitely many trials.
Tip 4: For continuous distributions, probabilities are calculated as areas under the PDF curve.
Tip 5: Always verify that probabilities sum to 1 (discrete) or integrate to 1 (continuous).
Common errors: Confusing discrete and continuous variables, forgetting normalization condition, misinterpreting expected value as the most likely outcome.
Memorization aid: "Discrete = Distinct values, Continuous = Continuum of values".
Advanced insight: Random variables are the foundation for statistical inference and probability modeling.
Essential formulas and properties:

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

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

• Discrete probability axioms: P(X = x) ≥ 0 and ΣP(X = x) = 1

• Continuous probability axioms: f(x) ≥ 0 and ∫f(x)dx = 1

• Binomial distribution: X ~ B(n,p), E[X] = np, P(X=k) = C(n,k)p^k(1-p)^(n-k)

Example progression (Simple to Complex):

• Simple: Fair die roll (uniform discrete)

• Intermediate: Expected value of a game

• Advanced: Continuous uniform distribution

• Complex: Binomial distribution applications

Key takeaways for memorization:

• Random variables map random outcomes to numbers

• Discrete: Countable values with probability masses

• Continuous: Uncountable values with probability densities

• Expected value is the theoretical average

• Probabilities must always sum/integrate to 1

Questions & Answers

Question: What's the difference between P(X = x) for discrete and continuous random variables?

Answer: This is a crucial distinction:

  • Discrete RV: P(X = x) can be greater than 0. Each specific value has a positive probability.
  • Continuous RV: P(X = x) = 0 for any specific value x. We only consider probabilities over intervals: P(a ≤ X ≤ b).

Think of it this way: For a continuous variable like height, the probability of someone being exactly 6 feet tall (to infinite precision) is zero, but the probability of being between 5.9 and 6.1 feet is positive.

Question: What does the expected value really mean? Is it the most likely outcome?

Answer: No, the expected value is NOT necessarily the most likely outcome! It's the long-run average:

  • It's the weighted average of all possible values
  • It represents what you'd expect on average over many trials
  • It might not even be a possible value of the random variable

Example: Rolling a fair die has E[X] = 3.5, but 3.5 is impossible to roll. However, if you roll many times, the average of your rolls will approach 3.5.

Question: How do I know when to use discrete vs continuous models in real-world situations?

Answer: Consider the nature of what you're measuring:

  • Discrete: Counting things (people, cars, defects, votes, coin flips)
  • Continuous: Measuring quantities (time, distance, weight, temperature, speed)

However, practically measured continuous variables often appear discrete due to rounding (height measured to nearest cm), but theoretically they're continuous. The model depends on the precision needed and the nature of the underlying process.