Utility Theory
Probability tells Bolt what to believe. But beliefs alone don't choose actions. Is a 16% chance of a pothole worth braking for? That depends on how bad a pothole crash is compared with a slightly slower delivery. We need a way to put numbers on preferences. That number is utility.
Lotteries: the language of risky choices
Every uncertain action is a lottery: a set of possible outcomes with probabilities:
$$ L = [\,p_1, S_1;\ p_2, S_2;\ \dots;\ p_n, S_n\,], \qquad \sum_i p_i = 1. $$Bolt's shortcut across the lawn is the lottery \([0.7, \text{arrive in 16 min};\ 0.3, \text{soaked food}]\). The covered route is the "lottery" \([1.0, \text{arrive in 20 min}]\), an outcome that is certain.
Preference notation:
- \(A \succ B\): the agent prefers A to B.
- \(A \sim B\): the agent is indifferent.
- \(A \succsim B\): prefers A or is indifferent.
The axioms of rational preference
What should a "rational" agent's preferences look like? Von Neumann and Morgenstern proposed six constraints. Each sounds obviously reasonable:
| Axiom | Statement | In words |
|---|---|---|
| Orderability | Exactly one of \(A\succ B\), \(B \succ A\), \(A\sim B\) | You can always compare two options |
| Transitivity | \(A \succ B,\ B \succ C \Rightarrow A \succ C\) | No preference cycles |
| Continuity | \(A \succ B \succ C \Rightarrow \exists p: [p, A; 1-p, C] \sim B\) | Something in the middle is equivalent to some gamble between the extremes |
| Substitutability | \(A \sim B \Rightarrow [p, A; 1-p, C] \sim [p, B; 1-p, C]\) | Swapping in equivalent outcomes doesn't change things |
| Monotonicity | \(A \succ B \Rightarrow (p > q \iff [p, A; 1-p, B] \succ [q, A; 1-q, B])\) | More chance of the better outcome is better |
| Decomposability | Compound lotteries reduce to simple ones by multiplying probabilities | "No fun in gambling": only final odds matter |
Suppose Bolt's controller has the cyclic preferences A ≻ B, B ≻ C and C ≻ A. Give it C. It will pay ₹1 to swap C for B (it prefers B), pay ₹1 to swap B for A, and then pay ₹1 to swap A for C, because it prefers C to A! It's back where it started, ₹3 poorer, and the loop can run forever. Intransitive agents can be exploited without limit. So the axioms aren't moral rules: violating them makes you exploitable, just like the Dutch book for probabilities.
The expected utility theorem
Von Neumann–Morgenstern theorem. If an agent's preferences obey the six axioms, then there exists a real-valued utility function \(U\) over outcomes such that
$$ A \succ B \iff U(A) > U(B), \qquad\text{and}\qquad U([p_1, S_1; \dots; p_n, S_n]) = \sum_i p_i\, U(S_i). $$In other words, a rational agent behaves as if it is maximizing expected utility.
This is a remarkable result. Nobody told the agent to compute averages. Consistency alone forces it. It also gives the principle of maximum expected utility (MEU):
$$ a^* = \arg\max_a\ \mathbb{EU}(a) = \arg\max_a \sum_{s'} P(s' \mid a)\, U(s'). $$Utilities: arrive in 16 min → 100, arrive in 20 min → 80, soaked food → 0. With P(rain) = 0.3:
- \(\mathbb{EU}(\text{covered}) = 1.0 \times 80 = 80\).
- \(\mathbb{EU}(\text{shortcut}) = 0.7 \times 100 + 0.3 \times 0 = 70\).
So Bolt takes the covered route. At what rain probability \(p\) do the two break even? \((1-p)\cdot 100 = 80\), so \(p = 0.2\). Below 20% rain, take the shortcut. This threshold is the decision, and it moves if either the probabilities or the utilities change.
Properties of utility functions
Only the shape matters: affine invariance
If \(U' = aU + b\) with \(a > 0\), then \(U'\) produces exactly the same decisions, because expectations are linear. So utilities have no absolute scale, and we can normalize: best outcome = 1, worst = 0. Something like \(U(S) = 3U(S')\) means nothing. Utilities are not "three times as happy."
But you can't apply arbitrary increasing transformations. \(U' = U^2\) can reverse choices between lotteries. (For deterministic choices only the ranking matters, so any increasing transformation works. Such ranking-only functions are called ordinal or value functions.)
How to measure someone's utility: the standard lottery
Normalize: \(U(\text{best}) = 1\), \(U(\text{worst}) = 0\). For any outcome \(S\), ask: "for what \(p\) are you indifferent between \(S\) for sure and the lottery \([p, \text{best}; 1-p, \text{worst}]\)?" Then \(U(S) = p\). For example, if Bolt's operators are indifferent between "20-minute delivery" and "a 90% chance of a 16-minute delivery, 10% chance of soaked food," then \(U(\text{20 min}) = 0.9\).
The utility of money
Is utility just money? Consider:
- A: ₹10 lakh for sure.
- B: a coin flip: ₹30 lakh or nothing.
B has the higher expected monetary value (EMV ₹15 lakh), but almost everyone takes A. The first ₹10 lakh changes your life. Going from ₹10 lakh to ₹30 lakh is nice but less dramatic. Money has diminishing marginal utility: \(U\) is concave in money.
A casino flips a coin until the first heads. If that happens on flip \(k\), you win ₹\(2^k\). Expected money \(= \sum_k \frac{1}{2^k}2^k = 1 + 1 + 1 + \dots = \infty\). Yet nobody would pay more than about ₹20 to play. Daniel Bernoulli (1738) proposed \(U(x) = \log x\). Then the expected utility is \(\sum_k \frac{1}{2^k}\log_2 2^k = \sum_k \frac{k}{2^k} = 2\), which is the utility of a sure ₹\(2^2\) = ₹4. That's a sensible price. Concave utility resolves the paradox.
Risk attitudes and the certainty equivalent
For a lottery \(L\), the certainty equivalent \(CE\) is the sure amount you'd accept instead: \(U(CE) = \mathbb{EU}(L)\). The risk premium is \(EMV(L) - CE(L)\), the amount you'd give up to remove the risk.
| Shape of \(U\) | Attitude | \(CE\) vs \(EMV\) | Example |
|---|---|---|---|
| Concave (\(\sqrt x\), \(\log x\)) | Risk-averse | \(CE < EMV\), premium > 0 | Buying insurance |
| Linear | Risk-neutral | \(CE = EMV\) | A large company making many small bets |
| Convex (\(x^2\)) | Risk-seeking | \(CE > EMV\), premium < 0 | Buying lottery tickets; desperate situations |
Worked example: \(U(x) = \sqrt{x}\), \(L = [0.5, ₹100\text{k};\ 0.5, ₹0]\). Then \(EMV = 50\text{k}\), \(\mathbb{EU} = 0.5\sqrt{100} + 0.5\cdot 0 = 5\), and \(CE = 5^2 = 25\text{k}\), so the risk premium is 25k. This agent would accept any sure offer above ₹25k instead of the gamble. Check it below: set ρ = 0.5 and p = 0.5.
Notice the geometry. The orange point \((EMV, \mathbb{EU})\) sits on the chord between the lottery's two outcomes, and the curve's height there is \(U(EMV)\). For a concave curve the chord lies below the curve, so \(\mathbb{E}[U(X)] \le U(\mathbb{E}[X])\). That's Jensen's inequality, and it's why concave means risk-averse.
Humans are not perfectly rational: the Allais paradox
Choose between:
- A: 80% chance of ₹4000 vs. B: ₹3000 for sure. (Most people choose B.)
- C: 20% chance of ₹4000 vs. D: 25% chance of ₹3000. (Most people choose C.)
With \(U(0) = 0\): B ≻ A means \(U(3000) > 0.8\,U(4000)\). C ≻ D means \(0.2\,U(4000) > 0.25\,U(3000)\), i.e. \(U(3000) < 0.8\,U(4000)\). That's a contradiction, so no utility function fits both choices. Humans overweight certainty (the "certainty effect"). This is one reason we build AI on the normative theory and not on human imitation (recall §1.1).
Several attributes at once
Real outcomes have several dimensions: time, cost, safety, food temperature. Two useful ideas:
- Strict dominance: if option A is at least as good as B on every attribute and better on one, discard B without needing any utilities.
- Additive utility: if attributes are preferentially independent, \(U(x_1,\dots,x_n) = \sum_i w_i U_i(x_i)\). This is the familiar weighted-scoring approach, and it's valid when preferences for one attribute don't depend on the levels of the others.
- Loss is negative utility. Minimizing expected squared loss in Chapter 2 is MEU with \(U = -(\hat y - y)^2\). The whole of supervised learning is a decision-theoretic choice.
- In MDPs (Ch 5), utility is defined over sequences of states as a (discounted) sum of rewards, and the agent maximizes expected utility over time.
- The value of information (§5.1) asks how much your expected utility would rise if you learned something before acting.
- Name and state the six axioms. Give the money-pump argument for transitivity.
- Compute EU of each action → pick the max → find the break-even probability.
- Compute EMV, CE and risk premium for a given \(U\). Classify risk attitude from the curvature of \(U\).
- Show that \(U' = aU + b\) (\(a>0\)) preserves decisions, and that \(U^2\) need not.