Introduction to Statistics · Chapter 4 · Random Variables

Mean or Expected Value and Standard Deviation

Every game of chance, every bet, and every probability distribution reduces to the same two numbers: where it balances, and how far it spreads.


bookSHelf · Introduction to Statistics · §4.2 · a self-paced section

Mean or Expected Value and Standard Deviation · bookSHelf Intro Stats§4.2

Learning objectives — by the end of this section you will be able to

Objectives

  1. Explain what the Law of Large Numbers says about the difference between short-term results and long-term averages §4.2.1
  2. Compute the expected value μ\mu of a discrete random variable by building an expected value table Definition 4.2.1
  3. Compute the standard deviation σ\sigma of a discrete probability distribution from its deviations Definition 4.2.2
  4. Interpret an expected value as a long-run average gain or loss, and decide whether a game or a bet is worth playing §4.2.3
  5. Recognize when an expected value table has been filled in incorrectly §4.2.4
Mean or Expected Value and Standard Deviation · bookSHelf Intro Stats§4.2

§4.2.1 — the long-term average

Expected Value: The Long-Term Average

Definition 4.2.1 — Expected Value (Mean) of a Discrete Random Variable

Let XX be a discrete random variable with probability distribution function P(x)P(x). The expected value, or mean, of XX is

μ=(xP(x)) \mu = \sum \left( x \cdot P(x) \right)

where the sum runs over every value xx that XX can take.

Definition 4.2.1 — the xP(x)x \cdot P(x) contributions land you on the same axis the outcomes live on.

Mean or Expected Value and Standard Deviation · bookSHelf Intro Stats§4.2

§4.2.1 — build the table, then add

The expected value table

In words: multiply each value of the random variable by its probability, then add all the products. That bookkeeping is easy to lose track of in your head, so we set it up in a table with one row per value of XX and one column for each piece of the formula.

Every problem you meet in this section — soccer schedules, lottery tickets, biased coins, earthquake bets — is the same three columns filled with different numbers. Build the table first and the arithmetic takes care of itself.

Mean or Expected Value and Standard Deviation · bookSHelf Intro Stats§4.2

§4.2.1 — from short-term noise to a long-term number

The Law of Large Numbers

Toss a coin twice and probability does not promise you one head, one tail — you might get nine heads in ten tosses. Probability says nothing about short-term results. Karl Pearson once tossed a fair coin 24,000 times to make exactly this point: he recorded 12,012 heads, a relative frequency of 0.5005, almost dead on the theoretical 0.5.

Law of Large Numbers: as the number of trials in a probability experiment increases, the difference between the theoretical probability of an event and its relative frequency approaches zero. That long-term average is called the mean or expected value, written μ\mu.

Mean or Expected Value and Standard Deviation · bookSHelf Intro Stats§4.2

Insight Note — "expected" does not mean "likely to happen"

The balance point, not a prediction

A family can have an expected number of 2.3 children, and no family has 2.3 children. The expected value is the balance point of the distribution, not a prediction of any single outcome. Read it as "the average over a very long run," never as "the result I should expect tonight."

Mean or Expected Value and Standard Deviation · bookSHelf Intro Stats§4.2

Your turn — three columns, then add

Try It Now 4.2.1

Try It Now 4.2.1 — a customer's water-bottle order

A customer orders 1, 2, or 3 bottles of water. P(1)=0.6P(1) = 0.6, P(2)=0.3P(2) = 0.3, P(3)=0.1P(3) = 0.1. Find the long-term average or expected value, μ\mu, of the number of bottles a customer will order.


xP(x)x · P(x)
10.60.6
20.30.6
30.10.3

Answer: μ=0.6+0.6+0.3=1.5\mu = 0.6 + 0.6 + 0.3 = 1.5 bottles. Over many customers, the store sells an average of 1.5 bottles per order.

Mean or Expected Value and Standard Deviation · bookSHelf Intro Stats§4.2

Worked example — the workhorse table in action

Example 4.2.1

Example 4.2.1 — A Soccer Team's Weekly Schedule

Coach Dana Whitfield's team plays soccer zero, one, or two days a week: P(0)=0.2P(0) = 0.2, P(1)=0.5P(1) = 0.5, P(2)=0.3P(2) = 0.3. Find the expected value, μ\mu, of the number of days per week the team plays.


xP(x)x · P(x)
00.20
10.50.5
20.30.6

Answer: μ=0+0.5+0.6=1.1\mu = 0 + 0.5 + 0.6 = 1.1. Dana's team would, on average, expect to play soccer 1.1 days per week — no single week has 1.1 practice days, but 1.1 is the long-term average across a season.

Mean or Expected Value and Standard Deviation · bookSHelf Intro Stats§4.2

§4.2.2 — how spread out the distribution is

The Standard Deviation of a Probability Distribution

Definition 4.2.2 — Standard Deviation of a Discrete Probability Distribution

Let XX be a discrete random variable with mean μ\mu. The standard deviation of XX is the square root of its variance:

σ=[(xμ)2P(x)] \sigma = \sqrt{\sum \left[ (x - \mu)^2 \cdot P(x) \right]}

Definition 4.2.2 — each deviation becomes a square, probability shrinks it, and the side of the pooled square is σ\sigma.

Mean or Expected Value and Standard Deviation · bookSHelf Intro Stats§4.2

§4.2.2 — the recipe from Chapter 2, with one change

What the standard deviation adds

The expected value tells you where the distribution balances. It says nothing about how spread out it is. Two distributions can share the same μ\mu and behave completely differently — one clustered tightly around the mean, one throwing you far to either side.

The recipe is the one from Chapter 2, with one change: there, every data point counted equally. Here, each value is weighted by how likely it is — a rare outcome far from the mean should not stretch the spread as much as a common one does.

Mean or Expected Value and Standard Deviation · bookSHelf Intro Stats§4.2

Context Pause — why the deviations get squared

Squaring counts distance, not direction

Values above the mean give positive deviations and values below give negative ones — added directly, they would cancel to zero every time. Squaring makes every deviation count as distance, regardless of direction. Taking the square root at the end puts the answer back into the original units.

Mean or Expected Value and Standard Deviation · bookSHelf Intro Stats§4.2

Your turn — probabilities as fractions of a sample

Try It Now 4.2.2

Try It Now 4.2.2 — a hospital nurse-call log

A hospital researcher tracks how many times the average post-op patient rings the nurse in a 12-hour shift. For a random sample of 50 patients: P(0)=450P(0){=}\tfrac{4}{50}, P(1)=850P(1){=}\tfrac{8}{50}, P(2)=1650P(2){=}\tfrac{16}{50}, P(3)=1450P(3){=}\tfrac{14}{50}, P(4)=650P(4){=}\tfrac{6}{50}, P(5)=250P(5){=}\tfrac{2}{50}. What is the expected value?


xP(x)x · P(x)
00.080
10.160.16
20.320.64
30.280.84
40.120.48
50.040.20

Answer: μ=2.32\mu = 2.32. A post-op patient rings the nurse an average of about 2.3 times per 12-hour shift.

Mean or Expected Value and Standard Deviation · bookSHelf Intro Stats§4.2

Worked example — adding the deviation column

Example 4.2.2

Example 4.2.2 — How Often a Newborn Wakes Its Parents

Mateo Reyes and his husband log how many times per week their newborn's crying wakes them after midnight: P(0)=250P(0){=}\tfrac{2}{50}, P(1)=1150P(1){=}\tfrac{11}{50}, P(2)=2350P(2){=}\tfrac{23}{50}, P(3)=950P(3){=}\tfrac{9}{50}, P(4)=450P(4){=}\tfrac{4}{50}, P(5)=150P(5){=}\tfrac{1}{50}. Find μ\mu and σ\sigma.


xP(x)x · P(x)(x − μ)² · P(x)
00.0400.1764
10.220.220.2662
20.460.920.0046
30.180.540.1458
40.080.320.2888
50.020.100.1682

Answer: μ=10550=2.1\mu = \tfrac{105}{50} = 2.1 wakings per week. σ=1.051.0247\sigma = \sqrt{1.05} \approx 1.0247. A typical week lands roughly one waking above or below 2.1, matching Mateo's log.

Mean or Expected Value and Standard Deviation · bookSHelf Intro Stats§4.2

§4.2.3 — expected value in games of chance

Set X to your profit

Expected value earns its keep fastest when the random variable is money. Set XX to your profit — what you walk away with minus what you paid — and μ\mu tells you your average gain or loss per play over the long run.

A positive μ\mu means the game pays you to play it. A negative μ\mu means it does not — no matter how good the jackpot sounds.

Mean or Expected Value and Standard Deviation · bookSHelf Intro Stats§4.2

§4.2.3 — the single most common mistake

Getting the sign right

In a game of chance the values of XX are almost never the numbers printed on the cards or the dice — they are the dollar amounts attached to those outcomes. Ask what you actually walk away with, not what the machine displays.

Write profit from the player's point of view: money you hand over is negative, money you receive is positive. A game that charges $2 and pays $100,000 has profit values of 2-2 and 100000100000, not 22 and 100,002100{,}002 — the $2 you paid comes back with the prize.

Mean or Expected Value and Standard Deviation · bookSHelf Intro Stats§4.2

Insight Note — the jackpot is not the story; the probability is

A big number times a tiny number can be small

A $100,000 prize looks enormous next to a $2 ticket, and it is. But 0.00001 is a very small number, and multiplying an enormous prize by a tiny probability can easily land under the price of the ticket. Expected value makes those two quantities comparable.

Mean or Expected Value and Standard Deviation · bookSHelf Intro Stats§4.2

Your turn — a near-fair game

Try It Now 4.2.3

Try It Now 4.2.3 — guessing four suits in a row

Four cards are drawn (with replacement) from a standard deck; you guess each suit before it is drawn. You pay $1 to play. Guess every suit correctly and you get your money back plus $256. What is your expected profit over the long term?


Step 1. P(win)=(14)4=12560.0039P(\text{win}) = \left(\tfrac{1}{4}\right)^4 = \tfrac{1}{256} \approx 0.0039, so P(lose)=255256P(\text{lose}) = \tfrac{255}{256}.

OutcomexP(x)x · P(x)
Win2561/2561
Lose−1255/256−0.9961

Answer: μ$0.004\mu \approx \$0.004 per game — less than half a cent. This game is very close to fair: over the long run you neither gain nor lose in any meaningful way.

Mean or Expected Value and Standard Deviation · bookSHelf Intro Stats§4.2

Worked example — a bet that loses on average

Example 4.2.3

Example 4.2.3 — A Five-Digit Lottery

Five numbers, 0–9, are drawn with replacement. You pay $2 to play and profit $100,000 if you match all five in order (you get your $2 back plus $100,000). What is your expected profit over the long term?


Step 1. P(win)=(110)5=0.00001P(\text{win}) = \left(\tfrac{1}{10}\right)^5 = 0.00001, so P(lose)=0.99999P(\text{lose}) = 0.99999.

OutcomexP(x)x · P(x)
Loss−20.99999−1.99998
Profit100,0000.000011

Answer: μ=0.99998$1\mu = -0.99998 \approx -\$1 per game. Notice what that number is not: each play you either lose $2 or profit $100,000, and neither is $1 — the $1 is the average loss after playing over and over.

Mean or Expected Value and Standard Deviation · bookSHelf Intro Stats§4.2

§4.2.4 — the same work, done in a different order

Reading a partly filled table

Sometimes a problem hands you a partly filled expected value table and asks you to finish it — the same work as before, done out of order. Two habits make this reliable:

  1. Check the P(x)P(x) column sums to 1. If it does not, either a probability is missing or one is wrong.
  2. Keep the sign of each xx honest. Money you pay is negative, money you win is positive — a sign error in one row flips the conclusion of the whole problem.
Mean or Expected Value and Standard Deviation · bookSHelf Intro Stats§4.2

Your turn — fill in the payouts, then the products

Try It Now 4.2.4

Try It Now 4.2.4 — a spinner game

P(red)=25P(\text{red}) = \tfrac{2}{5}, P(blue)=25P(\text{blue}) = \tfrac{2}{5}, P(green)=15P(\text{green}) = \tfrac{1}{5}. Red costs $10, blue costs and pays nothing, green wins $10. Complete the expected value table.


OutcomexP(x)x · P(x)
Red−102/5−4
Blue02/50
Green101/52

Answer: μ=4+0+2=$2\mu = -4 + 0 + 2 = -\$2. You lose an average of $2 every spin — not a game to play for money.

Mean or Expected Value and Standard Deviation · bookSHelf Intro Stats§4.2

Worked example — testing a booth game before it opens

Example 4.2.4

Example 4.2.4 — A Biased Coin

Nora Whitaker is testing a booth game before her fundraiser. P(heads)=23P(\text{heads}) = \tfrac{2}{3}, P(tails)=13P(\text{tails}) = \tfrac{1}{3}. Toss heads and you pay $6; toss tails and you win $10. Played many times, does the player come out ahead?


OutcomexP(x)x · P(x)
WIN (tails)101/310/3
LOSE (heads)−62/3−12/3

Answer: μ=103123=23$0.67\mu = \tfrac{10}{3} - \tfrac{12}{3} = -\tfrac{2}{3} \approx -\$0.67. The player loses about 67 cents a game on average — exactly why Nora is happy to keep it at her booth.

Mean or Expected Value and Standard Deviation · bookSHelf Intro Stats§4.2

§4.2.5 — one more column on the same table

Building the standard deviation column

Like data, probability distributions have standard deviations. Once you know μ\mu, the fourth column is a fixed recipe:

  1. Find each value's deviation from μ\mu: xμx - \mu.
  2. Square it, then multiply by that value's probability: (xμ)2P(x)(x-\mu)^2 \cdot P(x).
  3. Add the products, and take the square root: σ=(xμ)2P(x)\sigma = \sqrt{\sum (x-\mu)^2 P(x)}.
Mean or Expected Value and Standard Deviation · bookSHelf Intro Stats§4.2

§4.2.5 — the recipe, worked on Example 4.2.1's table

Table 4.2.6 — the soccer team, with its deviation column

xP(x)x · P(x)(x − μ)² · P(x)
00.200.242
10.50.50.005
20.30.60.243

Table 4.2.6: Adding a deviation column to the soccer team's expected value table (μ=1.1\mu = 1.1, from Example 4.2.1).

Add the last column: 0.242+0.005+0.243=0.4900.242 + 0.005 + 0.243 = 0.490, so σ=0.49=0.7\sigma = \sqrt{0.49} = 0.7. In practice, a calculator or computer does this arithmetic to cut round-off error — later sections give short-cut formulas for μ\mu and σ\sigma for specific distribution families.

Mean or Expected Value and Standard Deviation · bookSHelf Intro Stats§4.2

Your turn — count odd cards from two stacks

Try It Now 4.2.5

Try It Now 4.2.5 — two card stacks, numbered 1–8

One card is picked from each of two stacks numbered 1 to 8. Let XX = the number of cards showing an odd number. Find μ\mu and σ\sigma.


Step 1. Each stack: P(odd)=48=12P(\text{odd}) = \tfrac{4}{8} = \tfrac{1}{2}. Independent picks give P(0)=14P(0) = \tfrac{1}{4}, P(1)=12P(1) = \tfrac{1}{2}, P(2)=14P(2) = \tfrac{1}{4}.

xP(x)x · P(x)(x − μ)² · P(x)
01/401/4
11/21/20
21/41/21/4

Answer: μ=1\mu = 1 odd card, σ=0.50.7071\sigma = \sqrt{0.5} \approx 0.7071.

Mean or Expected Value and Standard Deviation · bookSHelf Intro Stats§4.2

Worked example — counting from a sample space

Example 4.2.5

Example 4.2.5 — Even Faces on Two Die Rolls

A fair six-sided die is tossed twice. Let XX = the number of faces showing even. The 36-outcome sample space has 9 outcomes with no even face, 18 with one, and 9 with two. Find μ\mu and σ\sigma.


xP(x)x · P(x)(x − μ)² · P(x)
09/3609/36
118/3618/360
29/3618/369/36

Answer: μ=3636=1\mu = \tfrac{36}{36} = 1 even face, σ=18360.7071\sigma = \sqrt{\tfrac{18}{36}} \approx 0.7071.

Mean or Expected Value and Standard Deviation · bookSHelf Intro Stats§4.2

§4.2.6 — real bets are rarely this tidy

When the Odds Come From Data

Every game so far handed you its probabilities cleanly — a fair coin, a spinner, a lottery with known digits. Real decisions are rarely that tidy: the probability is often an estimate from data — a forecast, a survey, a historical rate — and the expected value you compute is only as good as that estimate.

The arithmetic does not change. What changes is the report: state the assumption the probability rests on, and remember that a large standard deviation means the long-run average poorly describes any single outcome — a modest expected loss and a huge spread is exactly the shape of most bets people find tempting.

Mean or Expected Value and Standard Deviation · bookSHelf Intro Stats§4.2

Your turn — a forecast-based bet

Try It Now 4.2.6

Try It Now 4.2.6 — betting on an earthquake in Japan

On May 11, 2013, the 48-hour forecast probability of a moderate earthquake in Japan was about 1.08%. Win the bet and you win $100; lose it and you pay $10. Find μ\mu and σ\sigma of the profit XX.


OutcomexP(x)x · P(x)(x − μ)² · P(x)
win1000.01081.08127.87
loss−100.9892−9.8921.40

Answer: μ$8.81\mu \approx -\$8.81, σ=129.27$11.37\sigma = \sqrt{129.27} \approx \$11.37. Japan's 1.08% is far lower than Iran's 21.42% (next slide), so the same style of bet is a much worse deal here.

Mean or Expected Value and Standard Deviation · bookSHelf Intro Stats§4.2

Worked example — a modest loss, a huge spread

Example 4.2.6

Example 4.2.6 — Betting on an Earthquake

Kai Nakamura bets on the same May 11, 2013 window, but in Iran: the 48-hour forecast probability of a moderate earthquake was about 21.42%. Win and Kai wins $50; lose and Kai pays $20. Will Kai come out ahead over many bets?


OutcomexP(x)x · P(x)(x − μ)² · P(x)
win500.214210.71648.10
loss−200.7858−15.72176.66

Answer: μ$5.01\mu \approx -\$5.01, σ=824.76$28.72\sigma = \sqrt{824.76} \approx \$28.72. Kai loses about $5.01 per bet on average — but σ\sigma is far larger than that loss, which is what makes a bet like this feel winnable even though it is not.

Mean or Expected Value and Standard Deviation · bookSHelf Intro Stats§4.2

Key Terms — the vocabulary this section put to work

expected value — the long-term average of a random variable, μ=(xP(x))\mu = \sum (x \cdot P(x)); also called the mean of the distribution.

mean of a discrete random variable (μ\mu) — another name for the expected value; the balance point of the probability distribution.

Law of Large Numbers — as the number of trials increases, the relative frequency of an event approaches its theoretical probability.

expected value table — a table with one row per value of XX and columns for xx, P(x)P(x), and xP(x)x \cdot P(x), used to organize the expected-value calculation.

standard deviation of a probability distribution (σ\sigma) — the square root of [(xμ)2P(x)]\sum \left[(x - \mu)^2 P(x)\right]; it measures how far outcomes typically fall from the expected value.

fair game — a game whose expected profit is zero, so neither player gains nor loses money over the long run.

Mean or Expected Value and Standard Deviation · bookSHelf Intro Stats§4.2

The headline result

Two numbers describe any bet completely.

μ\mu says whether it pays you to play; σ\sigma says how far any single outcome can land from that average — Iran's earthquake bet: μ$5.01\mu \approx -\$5.01, σ$28.72\sigma \approx \$28.72. Japan's: μ$8.81\mu \approx -\$8.81, σ$11.37\sigma \approx \$11.37.

Both bets lose on average. The bet with the smaller expected loss (Iran) also carries the larger spread — the number that makes a losing bet feel winnable is σ\sigma, not the jackpot.

† Neither bet is a fair game — a fair game has μ=0\mu = 0 exactly, which neither of these forecasts produces. A near-fair game, like Try It Now 4.2.3's four-suit guess (μ$0.004\mu \approx \$0.004), is the closer analogue.

4.2
Mean or Expected Value and Standard Deviation · bookSHelf Intro Stats§4.2

§4.2 — conclusions

What §4.2 leaves you with

The core idea

μ=xP(x)\mu = \sum x \cdot P(x) is the balance point of a distribution; σ=(xμ)2P(x)\sigma = \sqrt{\sum (x-\mu)^2 P(x)} is its spread. Both come from the same three- or four-column table, one row per outcome, built the same way whether XX counts days, wakings, or dollars.

Watch for

A big prize is not a good deal by itself — multiply it by its (usually tiny) probability first. And check the columns: P(x)P(x) must sum to 1, and the third column is xP(x)x \cdot P(x), not a running total.

Next: §4.3 — The Binomial Distribution, where a repeated yes/no experiment gets its own shortcut formulas for μ\mu and σ\sigma.