Lecture 15: Expected Value#

STATS 60 / STATS 160 / PSYCH 10

Concepts and Learning Goals:

  • Expected value / expectation

  • Cost-benefit analysis with probability

If you’ve never missed a flight…#

you’ve been spending too much time at the airport!#

  • My mother in-law always insists on going to the airport 2 hours before her flight

  • She never misses her flights!

  • My brother usually goes to the airport 45 minutes before his flight.

  • He occasionally misses his flight, but he claims that he wastes less time at the airport overall.

How can we decide who is right?

An uncertain quantity#

There is some uncertainty every time you take a flight—you can never be sure if you’ll make it on time.

Let’s model this uncertain situation using probability!

Two strategies#

Let’s consider two strategies:

  1. Arrive at the airport 120 minutes (2 hours) before your flight.

    • In this case, the probability that you miss your flight is \(\frac{1}{50}\).

  2. Arrive at the airport 45 minutes before your flight.

    • In this case, the probability that you miss your flight is \(\frac{1}{5}\).

Say that when you miss your flight, you have to spend an additional 240 minutes (4 hours) at the airport waiting for the next flight.

How much time per trip, on average, will you spend at the airport if you use each strategy?

The expected value#

In the flight scenario, we have an unknown quantity, \(M\), the number of minutes you’ll spend at the airport.

We think of \(M\) as a random quantity:

  • We cannot be certain in advance what \(M\) will be!

  • It depends on whether we make our flight or not.

The expected value or expectation of \(M\), written \(\mathbb{E}[M]\), is the value it will take on average over all possible outcomes that could happen.

Last Friday, you saw the concept of the expected value in the context of sports; the idea was to figure out how different strategies affect the expected value of points scored in a game/match.

How many minutes in expectation?#

To calculate the expected value of \(M\), we have to sum

\[ \mathbb{E}[M] = \sum_m m \cdot \Pr[M = m]. \]

over all \(m\) that \(M\) could possibly be.

The mother in-law’s strategy#

  • With probability \(1 - \frac{1}{50}\), we make our flight, and spend \(120\) minutes at the airport.

  • With probability \(\frac{1}{50}\), we miss our flight, and spend \(240\) minutes at the airport.

Outcome

Probability

Value of \(M\)

made it

\(\frac{49}{50}\)

120

miss it

\(\frac{1}{50}\)

240

Let’s compute the expected value of the number of minutes spent at the airport per flight using my mother-in-law’s strategy:

\[ \mathbb{E}[M] = 120 \cdot \Pr[M = 120] + 240 \cdot \Pr[M = 240]\]
\[= 120 \cdot \frac{49}{50} + 240 \cdot \frac{1}{50} = 122.4\]

My mother in-law spends 122.4 minutes per flight on average.

The brother’s strategy#

  • With probability \(1 - \frac{1}{5}\), we make our flight, and spend \(45\) minutes at the airport.

  • With probability \(\frac{1}{5}\), we miss our flight, and spend \(240\) minutes at the airport.

Outcome

Probability

Value of \(M\)

made it

\(\frac{4}{5}\)

45

miss it

\(\frac{1}{5}\)

240

Question: compute the expected value of the number of minutes spent at the airport per flight using my brother’s strategy.

\[ \mathbb{E}[M] = 45 \cdot \Pr[M = 45] + 240 \cdot \Pr[M = 240] \]
\[= 45 \cdot \frac{4}{5} + 240 \cdot \frac{1}{5} = 84\]

My brother spends 84 minutes per flight on average.

Who is right?#

In expectation, by brother spends 38 minutes less than my mother-in-law per flight at the airport.

On any given flight, you may spend less or more minutes than the expected value.

However, the average number of minutes you spend per flight over many repeated flights will, with high confidence, be close to the expected value.

  • In the long term, over many flights, my brother really will spend less time at the airport than my mother in law.

  • But there is also a question of risk tolerance

    • My mother in law just hates the hassle of missing a flight.

  • Risk tolerance is not addressed by the expected value.

How many missed flights?#

Suppose you take 100 flights. Lets let \(F\) be the number of flights you’ll miss.

What is \(\mathbb{E}[F]\) if you use strategy 1?

Calculating \(\Pr[F = k]\) for each \(k\) between \(1\) and \(100\) sounds pretty annoying.

Linearity of expectation#

The expected value has a neat property:

  • Suppose you repeat the same experiment 100 times

  • Each time you take a measurement: say the measurements are \(F_1,\ldots,F_{100}\).

  • Say \(F = F_1 + F_2 + \cdots + F_{100}\).

  • Then \(\mathbb{E}[F] = 100 \cdot \mathbb{E}[F_1]\).

  • This is a consequence of something called linearity of expectation.

Now, how many missed flights?#

Suppose you take 100 flights.

Lets let \(F_i\) the number of flights you missed on your \(i\)th flight.

So \(F_i = 0\) if you made the flight and \(F_i = 1\) if you missed it.

We can write the total number of flights you missed, \(F\), as

\[F = F_1 + F_2 + \cdots + F_{100}.\]

Now using linearity of expectation, if my mother in law takes 100 flights, in expectation she misses

\[ \mathbb{E}[F] = 100 \cdot \mathbb{E}[F_1] = 100 \cdot \left(0 \cdot \frac{49}{50} + 1 \cdot\frac{1}{50}\right) = 2 \text{ flights}\]

Brother’s missed flights#

Question: If my brother takes 100 flights, what is the expected value of the number of flights he misses?

\[ \mathbb{E}[F] = 100 \cdot \mathbb{E}[F_1] = 100 \cdot \left(0 \cdot \frac{4}{5} + 1 \cdot\frac{1}{5}\right) = 20 \text{ flights}\]

Cost-benefit analysis#

We have been engaging in a cost-benefit analysis, informed by probability!

  1. Mother-in-law’s strategy:

    • in expectation, spend 122.4 minutes per flight at the airport

    • in expectation, miss 2 out of every 100 flights taken

  2. Brother’s strategy:

    • in expectation, spend 84 minutes per flight at the airport

    • in expectation, miss 20 out of every 100 flights taken

The strategy you prefer is informed by how much you value time vs. the anxiety of missing a flight!

Roulette#

The game of roulette features a wheel with 38 numbered pockets:

  • 18 colored red

  • 18 colored black

  • 2 colored green.

Players have an opportunity to place a bet on one or more pockets.

For example, if you place $ 1 on red, then if the wheel lands on red, you get $1, otherwise you pay $ 1.

Question: Let’s let \(W\) be the amount of money you win if you place $ 1 on red. What is \(\mathbb{E}[W]\)?

\(W = 1\) only if the wheel lands on red, otherwise \(W = -1\).

The probability that the wheel lands on red is \(\frac{18}{38}\).

So \(\mathbb{E}[W] = 1 \cdot \frac{18}{38} + (-1) \cdot \frac{20}{38} = -\frac{2}{38}\).

That is approximately \(-\$.05\).

Question: Is it worth it to bet on red in roulette?

On average, you will lose money!

To play, or not to play?#

Consider the following simple coinflip game:

  • You flip a fair coin.

  • If it lands on heads, you get $300.

  • If it lands on tails, you get nothing.

Question: How much would you be willing to pay in order to play this game? It may be helpful to calculate the expected value of your earnings.

Question: Does anything change if you can play it an unlimited number of times?

Answer: In expectation, the amount of money you make from playing this game is \(\frac{1}{2} (\$300) + \frac{1}{2}(\$0) = \$150\). So as long as you have to pay less than $150, in expectation you earn money.

Answer: If I can play an unlimited number of times, then my total profit will very likely be positive, since I know my long-term average winnings per game are very likely to be close to the expectation.

Venture Capital is playing the coinflip game#

Model investments in a company as follows:

  • Pay a seed fund of $10 million

  • Flip a coin with heads probability \(1/20\) (say)

  • If the coin lands heads, the company succeeds and makes its investors a lot of money, say, $500 million.

  • If the coin lands tails, the company fails and makes $0.

In expectation, the net earnings \(N\) for the investment are

\[\mathbb{E}[N] = ((\$500,000,000)\cdot \frac{1}{20} + (\$0)\cdot \frac{19}{20}) - \$10,000,000 = \$15,000,000\]

The expected value of this game is positive, and the VC has enough money to play this game over and over.

In the long term, the VC can be confident that (s)he will make money.

Expected Values everywhere#

Expected values are used to make decisions all the time!

  • Sports (last Friday)

  • Investments

  • Gambling (at least when pros gamble)

  • Insurance

  • Medicine and public health

Can you use expected values as a tool to make decisions in your own life?

Recap#

  • Expected value / expectation of random quantities

    • How to calculate it

    • For a random quantity \(Q\), its average value over many repeated experiments is close to \(\mathbb{E}[Q]\)

  • Applications to cost-benefit analysis