StatisticsRandom Variables2 of 4
Random Variables · 2

Expected Value

When a game or decision depends on chance, we cannot predict the next outcome, so we need a way to find what a single try is worth on average over the long run.

1

Expected Value as the Long-Run Average and Balance Point

We want to find the average payout per roll in a dice game where only two outcomes can happen. Suppose you roll a fair six-sided die once: rolling a 66 pays $12\val{\$12}, and rolling a 1,2,3,4,1, 2, 3, 4, or 55 pays $0\val{\$0}.

Expected Value as the Long-Run Average and Balance Point
$12\htmlClass{lc-blue}{\$12}
$0\htmlClass{lc-blue}{\$0}
fair price=  ?\text{fair price} = \;\htmlClass{lc-pink}{?}
$0\htmlClass{lc-blue}{\$0}
$2\htmlClass{lc-ink}{\$2}
$4\htmlClass{lc-ink}{\$4}
$6\htmlClass{lc-ink}{\$6}
$8\htmlClass{lc-ink}{\$8}
$10\htmlClass{lc-ink}{\$10}
$12\htmlClass{lc-blue}{\$12}
Lose\htmlClass{lc-ink}{\text{Lose}}
Win\htmlClass{lc-ink}{\text{Win}}
Text solution
Average over 600600 rollsOut of 600600 rolls, a fair die lands on 66 about 100100 times and on 11 through 55 about 500500 times, so we find the total winnings and divide by the 600600 rolls.
Average per roll\displaystyle \ev{\text{Average per roll}} =100×$12+500×$0600\displaystyle = \frac{100 \times \val{\$12} + 500 \times \val{\$0}}{600} =$1,200600\displaystyle = \frac{\$1{,}200}{600} =$2\displaystyle = \ev{\$2}
Split into probabilitiesSeparating the fraction shows that the 600600 rolls cancel out into each outcome's probability, 16\prob{\frac{1}{6}} and 56\prob{\frac{5}{6}}, so we can weight each outcome directly by its probability.
Expected value=100600×$12+500600×$0=(16×$12)+(56×$0)=$2+$0=$2\displaystyle \begin{aligned} \ev{\text{Expected value}} &= \frac{100}{600} \times \val{\$12} + \frac{500}{600} \times \val{\$0} \\ &= \left(\prob{\frac{1}{6}} \times \val{\$12}\right) + \left(\prob{\frac{5}{6}} \times \val{\$0}\right) \\ &= \$2 + \$0 = \ev{\$2} \end{aligned}

So the expected value of a roll is $2\ev{\$2}, even though a single roll can only ever pay $0\val{\$0} or $12\val{\$12}.

On the number-line beam, the balance point gets pulled toward whichever outcome has more probability blocks. It only sits right in the middle at $6\ev{\$6} when the 66 blocks are split evenly, 33 and 33.

The balance point is pulled toward whichever outcome holds more of the 6 blocks, sitting at the $6 midpoint only when the blocks are split 3 and 3.
2

Net Profit and Fair Games

In most games, you don't just collect payouts for free. You have to pay a ticket price upfront to play. We want to find your expected net profit per game after paying that fee, and find the ticket price that makes a game fair so neither side comes out ahead in the long run.

Suppose I charge you a $3\price{\$3} ticket price before you roll in the same dice game ($12\val{\$12} for rolling a 66, and $0\val{\$0} for rolling 11 through 55).

Net Profit and Fair Games
−$4\htmlClass{lc-ink}{-\$4}
$0\htmlClass{lc-blue}{\$0}
$4\htmlClass{lc-ink}{\$4}
$8\htmlClass{lc-ink}{\$8}
$12\htmlClass{lc-blue}{\$12}
56\htmlClass{lc-green}{\dfrac{5}{6}}
16\htmlClass{lc-green}{\dfrac{1}{6}}
$2\htmlClass{lc-violet}{\$2}
ticket price=$3\text{ticket price} = \htmlClass{lc-pink}{\$3}
fair price=  ?\text{fair price} = \;\htmlClass{lc-pink}{?}
Text solution
Subtract the ticket price from the expected payoutBecause you pay the $3\price{\$3} ticket price on every roll and win back $2\ev{\$2} on average, you can subtract the ticket price once at the end.
Expected net profit\displaystyle \ev{\text{Expected net profit}} =$2⏟expected payout−$3⏟ticket price\displaystyle = \underbrace{\ev{\$2}}_{\ev{\text{expected payout}}} - \underbrace{\price{\$3}}_{\price{\text{ticket price}}} =−$1\displaystyle = \ev{-\$1}
Or weight each outcome's net profitSubtracting the $3\price{\$3} ticket price from each payout first gives a net profit of $12−$3=+$9\val{\$12} - \price{\$3} = \val{+\$9} when you roll a 66 and $0−$3=−$3\val{\$0} - \price{\$3} = \val{-\$3} when you roll 11 through 55.
Expected net profit=(16×$9)+(56×−$3)=$96+−$156=−$66=−$1\displaystyle \begin{aligned} \ev{\text{Expected net profit}} &= \left(\prob{\frac{1}{6}} \times \val{\$9}\right) + \left(\prob{\frac{5}{6}} \times \val{-\$3}\right) \\ &= \frac{\$9}{6} + \frac{-\$15}{6} = -\frac{\$6}{6} = \ev{-\$1} \end{aligned}
Set expected net profit to $0\ev{\$0} for a fair gameA game is fair when neither player comes out ahead in the long run, which happens when the ticket price equals the $2\ev{\$2} expected payout.
Expected payout⏟$2−Fair price\displaystyle \underbrace{\ev{\text{Expected payout}}}_{\ev{\$2}} - \price{\text{Fair price}} =$0  ⟹  Fair price\displaystyle = \ev{\$0} \implies \price{\text{Fair price}} =$2\displaystyle = \ev{\$2}

With a $3\price{\$3} ticket, you lose an average of $1\ev{\$1} per roll in the long run, so the game is not fair; lowering the ticket price to $2\price{\$2} balances the wins and losses at $0\ev{\$0} per roll.

Paying a ticket price shifts the outcome stacks and the balance point to the left by that exact amount. That means the beam balances at $0\ev{\$0} net profit only when the ticket price equals the $2\ev{\$2} expected payout.

Charging a ticket price shifts every outcome and the balance point left by the exact same amount, so the game breaks even only when the ticket costs the average payout.
3

Warranties, Insurance, and Real-Life Risk

Protection plans and insurance policies work like a game where you pay an upfront price, except there are often more than two outcomes and the probabilities are given as percentages. We want to find the company's average repair cost per customer (their break-even price), your expected net value when you buy a policy, and how to decide when a negative expected value is still worth paying.

Suppose you buy a $1,000\$1{,}000 phone and are offered a two-year protection plan for $100\price{\$100}. Repair data shows that over two years, 85%\prob{85\%} of phones need no repairs ($0\val{\$0}), 10%\prob{10\%} need a $200\val{\$200} screen repair, and 5%\prob{5\%} need a full $1,000\val{\$1{,}000} replacement.

Warranties, Insurance, and Real-Life Risk
$1,000\htmlClass{lc-ink}{\$1{,}000}
Add a 2-year protection plan\htmlClass{lc-ink}{\text{Add a 2-year protection plan}}
for $100?\text{for }\htmlClass{lc-pink}{\$100}\text{?}
accept\htmlClass{lc-ink}{\text{accept}}
$0\htmlClass{lc-blue}{\$0}
$200\htmlClass{lc-blue}{\$200}
$400\htmlClass{lc-ink}{\$400}
$600\htmlClass{lc-ink}{\$600}
$800\htmlClass{lc-ink}{\$800}
$1,000\htmlClass{lc-blue}{\$1{,}000}
85%\htmlClass{lc-green}{85\%}
10%\htmlClass{lc-green}{10\%}
5%\htmlClass{lc-green}{5\%}
$70\htmlClass{lc-violet}{\$70}
Text solution
Check that the probabilities add to 1\prob{1}Convert the percentages to decimals and make sure every possible outcome, including nothing going wrong, is included.
0.85+0.10+0.05\displaystyle \prob{0.85} + \prob{0.10} + \prob{0.05} =1.00\displaystyle = \prob{1.00}
Weight each repair cost by its probabilityMultiply each repair cost by how often it happens and add the products to find the long-run average repair cost per phone.
Expected repair cost=(0.85×$0)+(0.10×$200)+(0.05×$1,000)=$0+$20+$50=$70\displaystyle \begin{aligned} \ev{\text{Expected repair cost}} &= (\prob{0.85} \times \val{\$0}) + (\prob{0.10} \times \val{\$200}) + (\prob{0.05} \times \val{\$1{,}000}) \\ &= \$0 + \$20 + \$50 = \ev{\$70} \end{aligned}
Subtract the plan price for the buyer's expected net valueThe company breaks even at $70\ev{\$70} per phone, so charging $100\price{\$100} gives the company +$30\ev{+\$30} per plan on average and leaves you with a negative expected net value.
Buyer’s expected net value\displaystyle \ev{\text{Buyer's expected net value}} =$70⏟expected repair cost−$100⏟plan price\displaystyle = \underbrace{\ev{\$70}}_{\ev{\text{expected repair cost}}} - \underbrace{\price{\$100}}_{\price{\text{plan price}}} =−$30\displaystyle = \ev{-\$30}
Compare a catastrophic loss (home insurance)If a $400,000\val{\$400{,}000} house has a 0.1%\prob{0.1\%} (0.001\prob{0.001}) chance of burning down this year and fire insurance costs $600\price{\$600} a year, we weight the loss the same way.
Expected fire loss=0.001×$400,000=$400  ⟹  Buyer’s expected net value=$400−$600=−$200\displaystyle \begin{aligned} \ev{\text{Expected fire loss}} &= \prob{0.001} \times \val{\$400{,}000} = \ev{\$400} \\ \implies \ev{\text{Buyer's expected net value}} &= \ev{\$400} - \price{\$600} = \ev{-\$200} \end{aligned}

Both policies have a negative expected net value for you (−$30\ev{-\$30} for the phone plan and −$200\ev{-\$200} for the house policy). Even so, it makes sense to skip the small phone warranty, since your repair costs will average out over a lifetime of buying phones, and buy the house insurance, since you cannot afford a single $400,000\val{\$400{,}000} loss.

4

The Expected Value Formula

To find the expected value of a discrete random variable X\val{X}, we multiply each possible value by its probability and add the products together. You will see that written with a single formula:

The Expected Value Formula
E[X]\displaystyle \ev{E[X]} =μX\displaystyle = \ev{\mu_X} =∑x⋅P(x)\displaystyle = \sum \val{x} \cdot \prob{P(\val{x})}

Every piece of the formula names a step we have already been doing:

E[X]⏟expected valueof X\displaystyle \underbrace{\ev{E[X]}}_{\ev{\substack{\text{expected value} \\ \text{of } X}}} =μX⏟mean (balance point)of X\displaystyle = \underbrace{\ev{\mu_X}}_{\ev{\substack{\text{mean (balance point)} \\ \text{of } X}}} =∑⏟add upx⏟whathappens⋅P(x)⏟how oftenit happens\displaystyle = \underbrace{\sum}_{\text{add up}} \underbrace{\val{x}}_{\val{\substack{\text{what} \\ \text{happens}}}} \cdot \underbrace{\prob{P(\val{x})}}_{\prob{\substack{\text{how often} \\ \text{it happens}}}}

The brackets in E[X]\ev{E[X]} and the subscript in μX\ev{\mu_X} just name which random variable we are averaging; they do not mean multiplication. On a test, write out the products (x1⋅P(x1)+x2⋅P(x2)+… )(\val{x_1} \cdot \prob{P(\val{x_1})} + \val{x_2} \cdot \prob{P(\val{x_2})} + \dots) before adding them so a single arithmetic slip doesn't hide a correct setup.

Key concepts

Whenever you need the long-run average of a discrete random variable X\val{X}, weight each possible outcome x\val{x} by its probability P(x)\prob{P(\val{x})} and add them up:

E[X]\displaystyle \ev{E[X]} =μX\displaystyle = \ev{\mu_X} =∑x⋅P(x)\displaystyle = \sum \val{x} \cdot \prob{P(\val{x})}
Finding the long-run average

Check first that the probabilities add to 1\prob{1} so the $0\val{\$0} outcome isn't left out, then sum the weighted outcomes. In the dice game, E[X]=(16×$12)+(56×$0)=$2\ev{E[X]} = \left(\prob{\tfrac{1}{6}} \times \val{\$12}\right) + \left(\prob{\tfrac{5}{6}} \times \val{\$0}\right) = \ev{\$2}, which is the long-run average per roll over many rolls, never an amount you can win on a single roll.

Accounting for an upfront ticket or plan price

Subtract the fixed price once from the expected payout (or expected benefit) rather than recalculating every outcome:

Expected net profit\displaystyle \ev{\text{Expected net profit}} =E[payout]−Price\displaystyle = \ev{E[\text{payout}]} - \price{\text{Price}}
For a $3\price{\$3} ticket on a game with a $2\ev{\$2} expected payout, your expected net profit is $2−$3=−$1\ev{\$2} - \price{\$3} = \ev{-\$1} per game.

Testing for a fair game or finding a break-even price

A game or plan is fair when the expected net profit is $0\ev{\$0}, which means the price to play equals the expected payout:

Fair price\displaystyle \price{\text{Fair price}} =E[payout]\displaystyle = \ev{E[\text{payout}]}
If a problem gives the ticket price and asks for the jackpot J\val{J} that makes the game fair, set ∑x⋅P(x)=Price\sum \val{x} \cdot \prob{P(\val{x})} = \price{\text{Price}} and solve for J\val{J}.

When not to follow expected value alone

Use expected value to guide decisions when you can afford the worst-case loss and repeat the choice many times (skipping a $100\price{\$100} phone warranty with an expected net value of −$30\ev{-\$30}). Do not rely on expected value alone when the worst-case outcome would bankrupt you (buying a $600\price{\$600} home insurance policy with an expected net value of −$200\ev{-\$200} to protect yourself from a $400,000\val{\$400{,}000} fire loss).

5

Practice

1

A coffee shop runs a promotion where every customer spins a digital wheel for a discount on their drink. The wheel lands on $0\$0 with probability 0.700.70, $2\$2 with probability 0.200.20, and $5\$5 with probability 0.100.10. Let XX be the discount amount. Find E[X]E[X], and explain whether a customer should expect to get that exact discount on their next spin.

Weight each discount amount by how often the wheel lands on it; then compare your result with the three numbers actually on the wheel.

Multiply each discount x\val{x} by its probability P(x)\prob{P(\val{x})} and add them together (watch out: taking a simple average $0+$2+$53=$2.33\frac{\val{\$0} + \val{\$2} + \val{\$5}}{3} = \miss{\$2.33} treats all three discounts as equally likely and ignores that $0\val{\$0} happens 70%\prob{70\%} of the time):
E[X]=(0.70×$0)+(0.20×$2)+(0.10×$5)=$0+$0.40+$0.50=$0.90\displaystyle \begin{aligned} \ev{E[X]} &= (\prob{0.70} \times \val{\$0}) + (\prob{0.20} \times \val{\$2}) + (\prob{0.10} \times \val{\$5}) \\ &= \$0 + \$0.40 + \$0.50 = \ev{\$0.90} \end{aligned}
A customer cannot get a $0.90\ev{\$0.90} discount on their next spin because a single spin can only land on $0\val{\$0}, $2\val{\$2}, or $5\val{\$5}; $0.90\ev{\$0.90} is the long-run average discount per spin over many customers.
2

You pay $4\$4 to draw one card at random from a deck of 1010 cards numbered 11 through 1010. If you draw the 1010, you win $20\$20. If you draw an 88 or 99, you win $5\$5. On any other card, you win $0\$0. What is your expected net profit per game, and is the game fair?

Count how many of the 1010 cards give each payout to find the expected payout first, then subtract the $4\$4 ticket price.

Out of 1010 cards, 11 card pays $20\val{\$20}, 22 cards (88 and 99) pay $5\val{\$5}, and 77 cards pay $0\val{\$0} (be careful to use 210\prob{\frac{2}{10}} rather than 110\miss{\frac{1}{10}} for the "88 or 99" payout, which would drop the expected payout to $2.50\miss{\$2.50} and give −$1.50\miss{-\$1.50}):
Expected payout=(110×$20)+(210×$5)+(710×$0)=$2+$1+$0=$3\displaystyle \begin{aligned} \ev{\text{Expected payout}} &= \left(\prob{\frac{1}{10}} \times \val{\$20}\right) + \left(\prob{\frac{2}{10}} \times \val{\$5}\right) + \left(\prob{\frac{7}{10}} \times \val{\$0}\right) \\ &= \$2 + \$1 + \$0 = \ev{\$3} \end{aligned}
Now subtract the $4\price{\$4} ticket price to find the expected net profit (don't stop at the $3\ev{\$3} expected payout, and if you subtract $4\price{\$4} from each outcome first, remember the 77 losing cards net −$4\val{-\$4}, not $0\miss{\$0}, or you will get +$1.80\miss{+\$1.80}):
Expected net profit\displaystyle \ev{\text{Expected net profit}} =$3−$4\displaystyle = \ev{\$3} - \price{\$4} =−$1\displaystyle = \ev{-\$1}
Because the expected net profit is −$1\ev{-\$1} per game instead of $0\ev{\$0}, the game is not fair.
3

A company sells an $800\$800 e-bike and offers a two-year protection plan for $65\$65. Over two years, 3%3\% of bikes need a $100\$100 battery repair, 2%2\% need a $300\$300 motor repair, 5%5\% are damaged beyond repair and need a full $800\$800 replacement, and the rest need no repairs. Find the company's expected repair cost per bike (the break-even price for the plan) and the buyer's expected net value for buying the $65\$65 plan.

Convert each percentage to a decimal to find the expected repair cost first, then subtract the $65\$65 plan price from the buyer's perspective.

The remaining 1−(0.03+0.02+0.05)=0.90\prob{1} - (\prob{0.03} + \prob{0.02} + \prob{0.05}) = \prob{0.90} of bikes need $0\val{\$0} in repairs. Multiply each repair cost by its decimal probability (watch the decimal places: writing 3%\prob{3\%}, 2%\prob{2\%}, and 5%\prob{5\%} as 0.3\miss{0.3}, 0.2\miss{0.2}, and 0.5\miss{0.5} multiplies the answer by 1010 to give $490\miss{\$490}):
Expected repair cost (break-even price)=(0.90×$0)+(0.03×$100)+(0.02×$300)+(0.05×$800)=$0+$3+$6+$40=$49\displaystyle \begin{aligned} \ev{\text{Expected repair cost (break-even price)}} &= (\prob{0.90} \times \val{\$0}) + (\prob{0.03} \times \val{\$100}) \\ &\quad + (\prob{0.02} \times \val{\$300}) + (\prob{0.05} \times \val{\$800}) \\ &= \$0 + \$3 + \$6 + \$40 = \ev{\$49} \end{aligned}
Now subtract the $65\price{\$65} plan price from the $49\ev{\$49} expected benefit to get the buyer's expected net value (subtracting $65−$49=+$16\price{\$65} - \ev{\$49} = \miss{+\$16} finds the company's average profit per plan instead of the buyer's net value):
Buyer’s expected net value\displaystyle \ev{\text{Buyer's expected net value}} =$49−$65\displaystyle = \ev{\$49} - \price{\$65} =−$16\displaystyle = \ev{-\$16}
4

You are deciding between two policies: (A) a $15\$15 extended warranty on a $100\$100 toaster that has a 10%10\% chance of breaking and needing full replacement, and (B) a $500\$500 annual fire insurance policy on a $300,000\$300{,}000 home that has a 0.1%0.1\% (0.0010.001) chance of burning down. Find your expected net value for each policy, and explain which one you should buy and why.

Find Expected loss−Policy price\text{Expected loss} - \text{Policy price} for each option, then ask which worst-case loss you could afford to pay for yourself if it happened once.

For the toaster warranty (A), the expected loss is 0.10×$100=$10\prob{0.10} \times \val{\$100} = \ev{\$10}:
Expected net value (A)\displaystyle \ev{\text{Expected net value (A)}} =$10−$15\displaystyle = \ev{\$10} - \price{\$15} =−$5\displaystyle = \ev{-\$5}
For the home fire policy (B), the expected loss is 0.001×$300,000=$300\prob{0.001} \times \val{\$300{,}000} = \ev{\$300} (be careful not to write 0.1%\prob{0.1\%} as 0.01\miss{0.01}, which makes the expected loss $3,000\miss{\$3{,}000} and gives +$2,500\miss{+\$2{,}500}):
Expected net value (B)\displaystyle \ev{\text{Expected net value (B)}} =$300−$500\displaystyle = \ev{\$300} - \price{\$500} =−$200\displaystyle = \ev{-\$200}
Even though both policies have negative expected net values (and −$5\ev{-\$5} is closer to $0\ev{\$0} than −$200\ev{-\$200}), you should skip the toaster warranty and buy the home insurance: over a lifetime of buying small appliances you can easily afford a $100\val{\$100} replacement and let the costs average out in the long run, whereas a single $300,000\val{\$300{,}000} house fire is a catastrophic loss you cannot afford.
5

A game costs $5\$5 to play. You roll a fair six-sided die: if it lands on 1,2,3,1, 2, 3, or 44, you win $0\$0; if it lands on 55, you win $6\$6; if it lands on 66, you win a jackpot of JJ dollars. What must the jackpot JJ be for this to be a fair game?

For the expected net profit to be $0\$0, what must the expected payout equal when the ticket costs $5\$5?

For a fair game, the expected payout must equal the $5\price{\$5} ticket price (if you use net profits instead, remember to subtract $5\price{\$5} on the four $0\val{\$0} outcomes too so they become −$5\val{-\$5}, or you will get J=$4\val{J} = \miss{\$4}):
(46×$0)+(16×$6)+(16×J)\displaystyle \left(\prob{\frac{4}{6}} \times \val{\$0}\right) + \left(\prob{\frac{1}{6}} \times \val{\$6}\right) + \left(\prob{\frac{1}{6}} \times \val{J}\right) =$5\displaystyle = \price{\$5}
Simplify and solve for J\val{J} (don't forget the $1\$1 average payout from rolling a 55, which would leave J6=$5\frac{\val{J}}{6} = \price{\$5} and give $30\miss{\$30}):
$1+J6\displaystyle \$1 + \frac{\val{J}}{6} =$5  ⟹  J6\displaystyle = \price{\$5} \implies \frac{\val{J}}{6} =$4  ⟹  J\displaystyle = \$4 \implies \val{J} =$24\displaystyle = \val{\$24}