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
heads payoff = $1
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.