Calculating the Mean of a Discrete Random Variable- Tutorial
What Is a Discrete Random Variable?
A discrete random variable takes on specific, countable values. The number of heads in 10 coin flips. The number of customers arriving per hour. The outcome of rolling a die. These are discrete because you can list out every possible value.
Continuous random variables are different—they can take any value within a range. Height. Temperature. Time. That's not what we're dealing with here.
What Does "Mean" Actually Mean Here?
When statisticians talk about the mean of a discrete random variable, they use the term expected value or E(X). Don't let the terminology confuse you—it's still fundamentally a weighted average.
The mean tells you what value you'd expect to see if you repeated an experiment an infinite number of times. It's not a prediction for a single trial. It's the long-run average.
The Formula
Here's what you're working with:
E(X) = Σ [x · P(x)]
That's the sum of every possible value multiplied by its probability. That's it. No magic, no complexity.
Breaking Down the Formula
- x = each possible outcome
- P(x) = probability of that outcome
- Σ = sum across all possible values
Step-by-Step Calculation
Let's work through a real example. You're rolling a fair six-sided die. What's the expected value?
Step 1: Identify All Outcomes
Values: 1, 2, 3, 4, 5, 6
Step 2: Identify Probabilities
Each outcome has probability 1/6 (assuming fair die)
Step 3: Multiply and Sum
E(X) = 1(1/6) + 2(1/6) + 3(1/6) + 4(1/6) + 5(1/6) + 6(1/6)
E(X) = (1+2+3+4+5+6)/6
E(X) = 21/6
E(X) = 3.5
Notice something? The expected value isn't even a possible outcome. You can never roll a 3.5 on a die. But it's still the correct mean.
Another Example: Weighted Die
What if the die is loaded? Let's say:
- P(1) = P(2) = P(3) = 1/8
- P(4) = P(5) = P(6) = 5/24
Verify these probabilities sum to 1: (3 × 1/8) + (3 × 5/24) = 3/8 + 15/24 = 9/24 + 15/24 = 24/24 = 1 ✓
E(X) = 1(1/8) + 2(1/8) + 3(1/8) + 4(5/24) + 5(5/24) + 6(5/24)
E(X) = 0.125 + 0.25 + 0.375 + 0.833 + 1.042 + 1.25
E(X) = 3.875
The expected value shifted toward the higher numbers because they have higher probabilities.
A Real-World Example
You're selling tickets for a raffle. 100 tickets sold at $5 each. One prize of $150.
What's your expected profit per ticket?
Probability you win: 1/100 = 0.01
Probability you lose: 99/100 = 0.99
Profit if you win: $150 - $5 = $145
Profit if you lose: -$5
E(Profit) = 145(0.01) + (-5)(0.99)
E(Profit) = 1.45 - 4.95
E(Profit) = -$3.50
On average, you lose $3.50 per ticket. The house always wins.
Common Mistakes
- Forgetting to check probabilities sum to 1. If they don't sum to 1, something's wrong with your problem setup. Stop and recheck.
- Confusing the mean with the median. They're not the same. The median is the middle value; the mean is the weighted average.
- Forgetting to multiply by probability. Just summing the outcomes gives you the wrong answer. Always multiply by P(x) first.
- Rounding too early. Keep exact fractions until the end. Rounding mid-calculation introduces error.
Properties of Expected Value
These shortcuts save time when you're working with complex problems:
- E(aX + b) = aE(X) + b — You can factor out constants
- E(X + Y) = E(X) + E(Y) — Expected value of a sum is the sum of expected values
- E(constant) = constant — The expected value of a fixed number is just that number
Example Using Properties
If E(X) = 10, what's E(3X + 5)?
E(3X + 5) = 3E(X) + 5 = 3(10) + 5 = 35
Practice Problem
A game costs $10 to play. You roll two dice. You win $2 for each dot showing (so 12 dice faces total = maximum $24 win).
What's your expected profit?
Total winnings from dice: ranges from 2 to 24
Net profit = winnings - $10
Expected winnings from two dice:
Each die: E = 3.5
Two dice: E = 3.5 + 3.5 = 7
Expected net profit = 7 - 10 = -$3
You lose $3 on average every time you play. The house edge is $3 per $10 wagered.
When to Use This
Expected value calculations show up in:
- Insurance risk assessment
- Investment decision-making
- Casino game analysis
- Quality control manufacturing
- Any scenario with probabilistic outcomes
The Bottom Line
Calculating the mean of a discrete random variable is straightforward: multiply each outcome by its probability, then sum everything up. The formula is simple. The execution is simple. Where people get tangled up is in setting up the problem correctly.
Make sure your probabilities are right. Make sure you're multiplying before summing. Make sure you understand what the expected value actually represents—a long-run average, not a single-trial prediction.
Get those pieces right and you'll never struggle with expected value again.