Understanding von Neumann–Morgenstern Expected Utility from Its Axioms

Environment

Python 3.14.6, NumPy 2.5.4, SciPy 1.18.1, Matplotlib 3.11.2 (Jupyter Notebook).

This article is a rewrite of a post from around 2021, with calculations performed in the environment described above.

Overview

For lotteries over a finite set of outcomes, we examine completeness, transitivity, continuity, and independence. We construct utility using the best and worst outcomes, derive an expected utility representation, and show uniqueness up to a positive affine transformation.

This article corresponds to Chapter 2, “Preferences and Expected Utility”, of The Theory and Practice of Decision Making. The numerical examples are illustrative, not observed data.

Setup

Run the cells in order. Round to three significant figures only when displaying results.

Check versions, import libraries, and configure plots
import sys
from pathlib import Path
from pprint import pprint

import numpy as np
import scipy
import matplotlib
import matplotlib.pyplot as plt
from matplotlib.ticker import FuncFormatter, ScalarFormatter
from matplotlib_inline.backend_inline import set_matplotlib_formats
from IPython.display import Math, display

# 表示だけを丸め、計算には丸める前の値を使う。
def s3(value):
    return format(float(value), "#.3g").rstrip(".")


np.set_printoptions(formatter={"float_kind": s3})
set_matplotlib_formats("svg")
plt.rcParams.update({
    "figure.figsize": (7, 4),
    "font.size": 11,
    "axes.spines.top": False,
    "axes.spines.right": False,
    "axes.grid": True,
    "grid.alpha": 0.200,
    "svg.fonttype": "path",
})
OUT_DIR = Path("105_nb_files")
OUT_DIR.mkdir(exist_ok=True)


def save_fig(fig, name):
    # 数値の目盛りだけを整形し、候補名などのラベルは保つ。
    for ax in fig.axes:
        for axis in (ax.xaxis, ax.yaxis):
            if isinstance(axis.get_major_formatter(), ScalarFormatter):
                axis.set_major_formatter(FuncFormatter(lambda x, pos: s3(x)))
    # SVGをファイルとセル出力の両方に残す。
    fig.tight_layout()
    fig.savefig(OUT_DIR / f"{name}.svg", format="svg", bbox_inches="tight")
    display(fig)
    plt.close(fig)


assert sys.version_info[:3] == (3, 14, 6), "Python 3.14.6のカーネルを選択すること"
print("実行環境: wa-src(3.14.6)")
print("Python:", sys.version.split()[0])
print("NumPy:", np.__version__, "SciPy:", scipy.__version__)
print("Matplotlib:", matplotlib.__version__)
実行環境: wa-src(3.14.6)
Python: 3.14.6
NumPy: 2.5.4 SciPy: 1.18.1
Matplotlib: 3.11.2

1. The choices are lotteries, not outcomes

Let the outcomes be $x_1,\ldots,x_m$ and represent a lottery by the probability vector $\mathbf{p}=(p_1,\ldots,p_m)^{\mathsf T}$, where $p_i\geq0$ and $\sum_i p_i=1$. The mixture $\alpha\mathbf{p}+(1-\alpha)\mathbf{q}$ means playing P with probability $\alpha$ and Q otherwise.

We reduce compound lotteries to probabilities of final outcomes. For example, selecting P with probability $\alpha$ and obtaining $x_i$ from P with probability $p_i$ gives that path probability $\alpha p_i$. Add the probabilities of paths leading to the same outcome.

2. Four axioms

Completeness means any two lotteries can be compared. Transitivity means that if A is at least as desirable as B, and B at least as desirable as C, then A is at least as desirable as C. Continuity rules out jumps in preference as mixing probabilities change slightly. On the space of lotteries with finitely many outcomes, it can be stated by requiring upper and lower preference sets to be closed.

Independence requires the following for any P, Q, R and $0<\alpha<1$.

$$ \mathbf{p}\succeq\mathbf{q} \iff \alpha\mathbf{p}+(1-\alpha)\mathbf{r} \succeq \alpha\mathbf{q}+(1-\alpha)\mathbf{r}. $$

Adding the same lottery R to both alternatives in the same proportion must preserve their ordering. This is different from statistical independence of random variables.

Under these conditions, preferences over lotteries can be represented by $U(\mathbf{p})=\sum_i p_i u(x_i)$. Conversely, preferences represented in this form satisfy all four axioms. Independence follows in particular from cancellation of the common term:

$$ U(\alpha\mathbf{p}+(1-\alpha)\mathbf{r}) -U(\alpha\mathbf{q}+(1-\alpha)\mathbf{r}) =\alpha\{U(\mathbf{p})-U(\mathbf{q})\}. $$

Because $\alpha>0$, the sign of the difference is unchanged.

3. Construct utility from the best and worst outcomes

Suppose there are best and worst outcomes $b$ and $w$ that are not indifferent. Continuity and independence give a probability $u_i\in[0,1]$ for each $x_i$ such that it is indifferent to the following standard lottery.

$$ x_i\sim u_i b+(1-u_i)w. $$

Define $u(x_i)=u_i$, giving $u(b)=1,u(w)=0$. If all outcomes are indifferent, constant utility represents the preferences and no nontrivial normalization is needed.

In a general lottery P, replace each $x_i$ in turn with its indifferent standard lottery. Independence ensures that the other branches do not affect this replacement. Reducing the compound lottery gives the following probability of the best outcome.

$$ \begin{aligned} \mathbf{p} &\sim\sum_i p_i\{u_i b+(1-u_i)w\}\\ &=\left(\sum_i p_i u_i\right)b+ \left(\sum_i p_i-\sum_i p_i u_i\right)w\\ &=U(\mathbf{p})b+\{1-U(\mathbf{p})\}w. \end{aligned} $$

A standard lottery is preferred when its probability of $b$ is higher. Hence $\mathbf{p}\succeq\mathbf{q}\iff U(\mathbf{p})\geq U(\mathbf{q})$. The point is to identify the preference conditions behind this representation, rather than simply assuming linearity in probabilities.

$$ \displaystyle U(P)=0.200\times0+0.500\times0.400+0.300\times1=0.500 $$

# 中間結果の標準くじとの無差別確率を0.400とする。
u = np.array([0, 0.400, 1])
p = np.array([0.200, 0.500, 0.300])
q = np.array([0.100, 0.700, 0.200])
r = np.array([1, 0, 0])
alpha = 0.250
mixed_p = alpha * p + (1 - alpha) * r
mixed_q = alpha * q + (1 - alpha) * r
pprint({"U(P)": s3(p @ u), "U(Q)": s3(q @ u),
        "混合後の差": s3((mixed_p - mixed_q) @ u)})
assert np.isclose((mixed_p - mixed_q) @ u, alpha * ((p - q) @ u))

mixing = np.linspace(0, 1, 101)
fig, ax = plt.subplots()
ax.plot(mixing, mixing * (p @ u) + (1 - mixing) * (r @ u), label="Mix P with R")
ax.plot(mixing, mixing * (q @ u) + (1 - mixing) * (r @ u), label="Mix Q with R")
ax.set(xlabel="Mixing probability alpha", ylabel="Expected utility")
ax.legend()
save_fig(fig, "01_independence")
{'U(P)': '0.500', 'U(Q)': '0.480', '混合後の差': '0.00500'}

4. Which changes of utility scale are allowed?

Suppose another expected utility function $v$ represents the same preferences over lotteries. Indifference between $x_i$ and its standard lottery implies

$$ \begin{aligned} v(x_i)&=u_i v(b)+(1-u_i)v(w)\\ &=\{v(b)-v(w)\}u_i+v(w)\\ &=a u_i+c,\qquad a>0. \end{aligned} $$

In the nontrivial case, utility is therefore unique up to a positive affine transformation. Conversely, if $v=au+c$, then $\sum_i p_i v_i=aU(\mathbf{p})+c$, preserving every lottery ranking. These allowed transformations are narrower than the arbitrary strictly increasing transformations of ordinal utility.

With three outcomes, $p_0=1-p_1-p_2$ and $U=0.400p_1+p_2$. The triangle in the next figure is the feasible probability region. The straight lines join lotteries with equal expected utility.

transformed_u = 3 * u + 7
assert np.isclose(p @ transformed_u, 3 * (p @ u) + 7)
pprint({"元の効用": u, "正のアフィン変換": transformed_u})

p1, p2 = np.meshgrid(np.linspace(0, 1, 121), np.linspace(0, 1, 121))
expected_u = np.ma.masked_where(p1 + p2 > 1, 0.400 * p1 + p2)
fig, ax = plt.subplots(figsize=(6, 5))
contours = ax.contour(p1, p2, expected_u, levels=np.linspace(0.100, 0.900, 9))
ax.clabel(contours, fmt=lambda x: s3(x))
ax.plot([0, 1, 0, 0], [0, 0, 1, 0], color="gray")
ax.scatter([p[1], q[1]], [p[2], q[2]], color=["tab:red", "tab:blue"])
ax.annotate("P", (p[1], p[2]), xytext=(6, 6), textcoords="offset points")
ax.annotate("Q", (q[1], q[2]), xytext=(6, 6), textcoords="offset points")
ax.set(xlabel="Probability of middle outcome", ylabel="Probability of best outcome")
save_fig(fig, "02_lottery_simplex")
{'元の効用': array([0.00, 0.400, 1.00]), '正のアフィン変換': array([7.00, 8.20, 10.0])}

5. The axioms can also be checked against choices

One can construct preference patterns that violate independence. For amounts 0, 1, and 5, let A give 1 for certain, B have probabilities $(0.0100,0.890,0.100)$, C have $(0.890,0.110,0)$, and D have $(0.900,0,0.100)$.

Preferring A strictly to B requires the following under expected utility.

$$ u(1)>0.0100u(0)+0.890u(1)+0.100u(5) \iff0.110u(1)>0.0100u(0)+0.100u(5). $$

However, rearranging the condition for strictly preferring D to C gives the opposite inequality. No expected utility function can satisfy both strict preferences. This is an example of the preference pattern known as the Allais paradox. These preferences are assumed for illustration; no participant data are presented here.

Treat the axioms as conditions under which particular calculations are valid. When a choice violates an axiom, identify the condition that fails and examine whether the model fits the decision problem.

Conclusion

We derived expected utility from four lottery axioms by substitution with standard lotteries and established its range of uniqueness.

Independence requires preferences to retain their order when a common lottery is mixed into both options. When preferences cannot be explained by expected utility, examine the axioms and presentation of information as well as the utility values.

References

Muhamet Yildiz, Decision Making under Risk, MIT OpenCourseWare . Reference for the expected utility theorem and construction using standard lotteries.