📊 Discrete Random Variables

1. What is a Random Variable?

A random variable is a variable whose value is determined by the outcome of a random experiment. Think of it as a function that assigns a numerical value to each outcome.

A discrete random variable can only take specific, countable values (like 0, 1, 2, 3, etc.). These are different from continuous random variables, which can take any value in a range.

Examples of Discrete Random Variables:
• X = number of heads when flipping 3 coins (possible values: 0, 1, 2, 3)
• Y = number of defective items in a batch of 10 (possible values: 0, 1, 2, ..., 10)
• Z = sum of two dice rolls (possible values: 2, 3, 4, ..., 12)
• W = number of customers arriving in an hour (possible values: 0, 1, 2, 3, ...)
Example 1: Rolling Two Dice

Let X = sum of two dice. What are the possible values?

Answer: X can be 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, or 12

This is a discrete random variable because it only takes specific integer values.

📝 Practice Question

Which of the following is NOT a discrete random variable?
A) Number of students absent from class
B) Number of emails received in a day
C) Height of a randomly selected person
D) Number of cars in a parking lot

2. Probability Distributions

A probability distribution lists all possible values of a discrete random variable along with their probabilities. It shows us the complete picture of how probability is distributed across all outcomes.

Example Distribution: Flipping 2 Coins

Let X = number of heads

X (# of heads) 0 1 2
P(X) 1/4 1/2 1/4
0.25 X=0
0.50 X=1
0.25 X=2
Properties of Probability Distributions:
• Each probability must be between 0 and 1: 0 ≤ P(X) ≤ 1
• The sum of all probabilities must equal 1: ΣP(X) = 1
• Every possible value must be listed

📝 Practice Question

For a valid probability distribution, the sum of all probabilities must equal:
A) 0
B) 1
C) 100
D) The number of possible values

3. Expected Value (Mean)

The expected value (also called the mean) of a discrete random variable is the average value we would expect if we repeated the experiment many times. It's denoted as E(X) or μ.

E(X) = μ = Σ[x · P(x)]

Sum of (each value × its probability)
Example 2: Calculating Expected Value

A game costs $5 to play. You roll a die and win money based on the result:

• Roll 6: win $20

• Roll 4 or 5: win $10

• Roll 1, 2, or 3: win $0

What is the expected winnings?

Solution Steps:

E(X) = $20 × (1/6) + $10 × (2/6) + $0 × (3/6)
E(X) = $20/6 + $20/6 + $0
E(X) = $40/6 ≈ $6.67
Expected profit = $6.67 - $5 = $1.67 per game
Important Notes:
• Expected value is NOT necessarily a possible value of X
• It represents the long-run average
• Useful for decision-making and comparing options

📝 Practice Question

A random variable X has the following distribution: P(X=1)=0.3, P(X=2)=0.5, P(X=3)=0.2. What is E(X)?
A) 1.5
B) 1.9
C) 2.0
D) 2.5

4. Variance and Standard Deviation

While expected value tells us the center of a distribution, variance and standard deviation tell us about the spread or variability.

Variance: Var(X) = σ² = Σ[(x - μ)² · P(x)]

Or equivalently: Var(X) = E(X²) - [E(X)]²

Standard Deviation: σ = √Var(X)
What They Tell Us:
• Variance (σ²): Average squared distance from the mean
• Standard Deviation (σ): Typical distance from the mean (in original units)
• Higher values = more spread out / more variability
• Lower values = more concentrated around the mean
Example 3: Calculating Variance

Let X = number of heads in 2 coin flips. We found E(X) = 1.

X 0 1 2
P(X) 0.25 0.50 0.25

Calculating Variance:

Var(X) = (0-1)² × 0.25 + (1-1)² × 0.50 + (2-1)² × 0.25
Var(X) = 1 × 0.25 + 0 × 0.50 + 1 × 0.25
Var(X) = 0.25 + 0 + 0.25 = 0.5
Standard Deviation: σ = √0.5 ≈ 0.707

📝 Practice Question

If two distributions have the same mean but different variances, what does this tell us?
A) They have the same spread
B) They have different amounts of variability
C) They must have different expected values
D) One must be continuous and one discrete

5. Binomial Distribution

The binomial distribution is one of the most important discrete probability distributions. It models the number of successes in a fixed number of independent trials.

Binomial Distribution Requirements:

• Fixed number of trials (n)
• Each trial has only two outcomes: success or failure
• Probability of success (p) is the same for each trial
• Trials are independent
• We count the number of successes (X)
P(X = k) = C(n,k) × p^k × (1-p)^(n-k)
Where: n = number of trials, k = number of successes, p = probability of success
Binomial Distribution Formulas:
• Mean: E(X) = n × p
• Variance: Var(X) = n × p × (1-p)
• Standard Deviation: σ = √[n × p × (1-p)]
Example 4: Free Throws

A basketball player makes 70% of free throws. She takes 5 shots. What's the probability she makes exactly 3?

Solution:

n = 5 trials, k = 3 successes, p = 0.7
P(X=3) = C(5,3) × (0.7)³ × (0.3)²
P(X=3) = 10 × 0.343 × 0.09
P(X=3) = 0.3087 or about 31%

Expected makes: E(X) = 5 × 0.7 = 3.5 shots

📝 Practice Question

A fair coin is flipped 10 times. What is the expected number of heads?
A) 5
B) 10
C) 2.5
D) 7.5

6. Geometric Distribution

The geometric distribution models the number of trials needed to get the first success. It answers questions like "How many times do I need to try before I succeed?"

Geometric Distribution

• Independent trials
• Same probability of success (p) each time
• We count trials until the FIRST success
• X can be 1, 2, 3, 4, ... (unlimited)
P(X = k) = (1-p)^(k-1) × p
Where: k = trial on which first success occurs, p = probability of success
Geometric Distribution Formulas:
• Mean: E(X) = 1/p
• Variance: Var(X) = (1-p)/p²
Example 5: Rolling Until You Get a 6

What's the probability that you need exactly 4 rolls to get your first 6?

Solution:

p = 1/6 (probability of rolling a 6)
P(X=4) = (5/6)³ × (1/6)
P(X=4) = 0.579 × 0.167
P(X=4) ≈ 0.096 or about 9.6%

Expected rolls until first 6: E(X) = 1/(1/6) = 6 rolls

Example 6: Product Testing

A quality inspector tests items until finding a defective one. If 5% of items are defective, how many items should they expect to test on average?

Solution:

E(X) = 1/p = 1/0.05 = 20 items

📝 Practice Question

The main difference between binomial and geometric distributions is:
A) Binomial requires independent trials, geometric doesn't
B) Binomial has fixed trials, geometric counts trials until first success
C) They use different probability formulas
D) Binomial is discrete, geometric is continuous

🎯 Lesson Summary

Excellent work! You've mastered discrete random variables. Here's what you learned:

  • ✅ Random variables: Assign numerical values to outcomes
  • ✅ Probability distributions: Show all values and their probabilities
  • ✅ Expected value: E(X) = Σ[x · P(x)] - the long-run average
  • ✅ Variance & std dev: Measure spread and variability
  • ✅ Binomial distribution: Fixed trials, count successes; E(X) = np
  • ✅ Geometric distribution: Count trials until first success; E(X) = 1/p

Next lesson: We'll explore continuous probability distributions!