A friend was wisting after math that aids with decision-making, so I thought I’d whip up a quick worked example of expected utility. Expected utility is math for making discrete decisions based on probabilities and desired outcomes.
The classic example is “Should I take an umbrella?” It might rain, or it might not. How bad is it if I take an umbrella when I don’t need one? How bad if I’m caught out in the rain without an one?
We consider four outcomes (and give them catchy shorthands):
- NUNR – No Umbrella, No Rain. i.e. I didn’t take an umbrella, and it didn’t rain.
- YUNR – Yes Umbrella, No Rain. i.e. I took an umbrella and it didn’t rain.
- YUYR – Yes Umbrella, Yes Rain. i.e. I took an umbrella and it rained.
- NUYR – No Umbrella, Yes rain. i.e. I didn’t take an umbrella, and it rained.
Let’s decide how much we like each of these. Yes, this is pretty arbitrary. We assign numeric values to each outcome:
- NUNR – 10 – This is the best outcome, right? You didn’t get rained on and you didn’t lug an umbrella!
- YUNR – 9 – This is almost as good as NUNR. You didn’t get rained on, yay, but you did have to lug an umbrella.
- YUYR – 6 – Not quite as good. You got rained on. You’re protected by your umbrella, but getting rained on still sucks.
- NUYR – 0 – Oh man. You didn’t bring an umbrella and you got rained on. This is the worst of all possible worlds.
Congrats, you’ve assigned utility values to your outcomes. This list of outcomes and values is collectively called a “utility function”.
We can refer to these quickly using the notation “U()”. That is, if I say “U(NUNR)”, know that I mean “the utility value of NUNR”, which is 10.
Pause for a quick aside: these values are entirely subjective. Different people can have different utility functions. Me, I’m the nervous type – I’d rate YUNR higher than NUNR. Because I’m not bothered by having the umbrella in my backpack, but I am bothered by the nervous worry that I’m going to get rained on while not having an umbrella. Everyone’s got their own considerations, and so everyone has their own utility functions. But let’s proceed with the utility function I gave above.
So we’ve got our utility function. Let’s say we checked the weather channel this morning, and they’re saying there’s a 10% chance of rain. We can refer to the probability of something using the notation “P()”. That is, “P(rain)” is “the probability of rain”, which is 10%.
And we have our two options – “Take an umbrella” or “Don’t take an umbrella”. Let’s calculate the expected utility of each option.
Option 1: Take an umbrella
Only two of our four outcomes are even possible if we take an umbrella – YUNR and YUYR. If we take an umbrella, then both “No Umbrella” scenarios have a probability of 0, and don’t need to be considered.
If we take an umbrella and there’s a 10% chance of rain, then the probability of YUYR is 10%. That is, P(YUYR) = 10%. We can also infer that the probability of no rain is 90%, so P(YUNR) = 90%.
We calculate the expected utility of taking an umbrella by multiplying the probability of each outcome by the utility value of each outcome, and adding them up. So the expected utility of taking an umbrella is:
P(YUYR) * U(YUYR) + P(YUNR) * U(YUNR)
= 10% * 6 + 90% * 9
= 0.6 + 8.1
The expected utility of taking an umbrella is 8.7.
Option 2: Don’t take an umbrella
Again, only two of our four outcomes are possible if we don’t take an umbrella – NUNR and NUYR.
The probability of rain is still 10%, and so we calculate our expected utility by multiplying the probability of each outcome by the utility value of that outcome, and adding them up:
P(NUYR) * U(NUYR) + P(NUNR) * U (NUNR)
= 10% * 0 + 90% * 10
= 0 + 9
The expected utility of not taking an umbrella is 9.
Given that taking an umbrella had a lower expected utility (8.7) than not taking an umrella (9), you shouldn’t take an umbrella.
Now, again, these calculations are all based on specific parameters. They’re based on how much you like each outcome (your utility function), and the probability of rain.
If we keep the same utility function, but increase the probability of rain to 20%, then our calculations change:
- Expected utility of taking an umbrella = 20% * 6 + 80% * 9 = 7.2 + 1.2 = 8.4
- Expected utility of not taking an umbrella = 20% * 0 + 80% * 10 = 8
Thus, if the probability of rain is as high as 20%, you should totally take an umbrella.
Money, and Second Chances
Two pitfalls, which I’m not going to detail here, are worth at least mentioning:
- When money is involved, people tend to use the money gained or lost as the utility function. This is only a valid choice in certain circumstances.
- The utility function for something at which you only get one chance is and should be different from the utility function for something you’re able to do over and over.