## Expected Value

Expected value is how much you expect to gain or lose from an action based on the probabilities and payoffs of all possible outcomes. It is used for making decisions involving risk, pricing insurance policies, calculating gambling payouts, etc.
To calculate expected value, multiply the probability of each outcome by the payoff, and add all of the results together. For example, you flip a coin with a friend. If you flip heads, your friend gives you \$1, but if you flip tails, you give your friend \$1. To calculate the expected value of flipping a coin, do the following:
```heads probability =  0.5
tails probability =  0.5
tails payoff      = -\$1
expected value    = (0.5 × \$1) + (0.5 × -\$1) = 0
```
In the example above, the expected value is 0, which means on average, you would not expect to gain or lose anything by flipping a coin. If the expected value is positive, you would expect to gain, and if the expected value is negative, you would expect to lose.
Note that expected value is just an average. On any particular coin flip, you are guaranteed to either gain or lose, and over a small number of coin flips, you may gain or lose a lot. But over a large number of coin flips, the amount you gain or lose will converge to the expected value. This principle is called the law of large numbers, and is how insurance companies and casinos can be consistently profitable.

### Exercise 1 of 6

You own an ice cream shop, and you want to buy a large batch of a new flavor of ice cream. There's a 95% chance you will gain \$5,000 profit from selling this new flavor. But there's a 5% chance your freezer will break down, in which case the ice cream will melt, and you will lose the \$10,000 you spent on this new flavor. What's the expected value of buying this new flavor?

### Exercise 2 of 6

You want to start your own company that will research the science of teleportation, and ultimately produce teleportation machines if the research is successful. There's a 99% chance you will fail, in which case you will lose the \$10,000 you invested in your company. But there's a 1% chance you will gain \$2,500,000 profit by revolutionizing how people go places. What's the expected value of starting this company?

### Exercise 3 of 6

You own a car insurance company, and you want to insure a new driver. You determined there's a 6% chance they will get into a minor accident costing you \$1,500, and a 2% chance they will total their car costing you \$35,000. Based on these probabilities, you price their policy at \$945 per year. How much do you expect to gain per year? Note that the \$945 is a guaranteed payment.

### Exercise 4 of 6

You own a car insurance company, and you just insured a new driver. Based on your calculated probabilities, you had priced their policy at \$945 per year. However, this driver immediately totaled their car, costing you a lot of money. You now determine there's a 9% chance they will get into a minor accident costing you \$1,500, and a 4% chance they will total their car costing you \$35,000. If you don't increase their policy price, how much do you expect to lose per year?

### Exercise 5 of 6

In the casino game roulette, a croupier spins a wheel with 38 pockets. The pockets are numbered 1-36, plus a 0 and 00. Players can bet on a ball landing in a particular pocket. If the ball lands in the pocket they bet on, they gain 35 times their bet amount. Otherwise, they lose their bet amount. How many cents should players expect to lose per dollar bet? Don't include a \$, and round to two decimal places.

### Exercise 6 of 6

Most states run lotteries. California runs several lotteries. One of them is called Fantasy 5. Players pick 5 numbers between 1 and 39 with no repeats, and the winning numbers are drawn with no repeats. Players win the jackpot if they match all 5 numbers in any order. The jackpot is split if multiple players win, and players can win smaller prizes if they match some of their numbers only, but disregard all of that for this exercise. If a lottery ticket costs \$1, and the jackpot is \$250,000, how many cents should players expect to lose per ticket? After one number is drawn, there are only 38 numbers to draw from, etc.