Intelligence 2E

foundations of computational agents

The third edition of Artificial Intelligence: foundations of computational agents, Cambridge University Press, 2023 is now available (including full text).

The expected value of a numerical function on worlds is the function’s average value, averaged over all possible worlds.

Let $f$ be a function on worlds. $f$ could select the value of one of the random variables, it could be the number of bits used to describe the world, or it could be some measure of how much an agent likes the world.

The expected value of $f$, written ${\mathcal{E}}_{P}(f)$, with respect to probability $P$ is

${\mathcal{E}}_{P}(f)=$ | $\sum _{\omega \in \mathrm{\Omega}}}f(\omega )*P(\omega )$ |

One special case is if $\alpha $ is a proposition, and $f$ is the function that has value 1 when $\alpha $ is true, and 0 otherwise, then ${\mathcal{E}}_{P}(f)=P(\alpha )$.

In an electrical domain, if ${n}{\mathit{}}{u}{\mathit{}}{m}{\mathit{}}{b}{\mathit{}}{e}{\mathit{}}{r}{\mathit{}}{\mathrm{\_}}{\mathit{}}{o}{\mathit{}}{f}{\mathit{}}{\mathrm{\_}}{\mathit{}}{b}{\mathit{}}{r}{\mathit{}}{o}{\mathit{}}{k}{\mathit{}}{e}{\mathit{}}{n}{\mathit{}}{\mathrm{\_}}{\mathit{}}{s}{\mathit{}}{w}{\mathit{}}{i}{\mathit{}}{t}{\mathit{}}{c}{\mathit{}}{h}{\mathit{}}{e}{\mathit{}}{s}$ is the number of switches broken,

$${{\mathcal{E}}}_{{P}}{}{(}{n}{}{u}{}{m}{}{b}{}{e}{}{r}{}{\mathrm{\_}}{}{o}{}{f}{}{\mathrm{\_}}{}{b}{}{r}{}{o}{}{k}{}{e}{}{n}{}{\mathrm{\_}}{}{s}{}{w}{}{i}{}{t}{}{c}{}{h}{}{e}{}{s}{)}$$ |

would give the expected number of broken switches given by probability distribution ${P}$. If the world acted according to the probability distribution ${P}$, this would give the long-run average number of broken switches. If there were three switches, each with a probability of ${\mathrm{0.7}}$ being broken, the expected number of broken switches is:

${0}{*}{{0.3}}^{{3}}{+}{1}{*}{3}{*}{0.7}{*}{{0.3}}^{{2}}{+}{2}{*}{3}{*}{{0.7}}^{{2}}{*}{0.3}{+}{3}{*}{{0.7}}^{{3}}{=}{2.01}$ |

where ${\mathrm{3}}$ is in the middle two products because there are 3 worlds with 1 switch broken, and 3 worlds with 2 switches broken.

In a manner analogous to the semantic definition of conditional probability, the conditional expected value of $f$ conditioned on evidence $e$, written $\mathcal{E}(f\mid e)$, is

$\mathcal{E}(f\mid e)=$ | $\sum _{\omega \in \mathrm{\Omega}}}f(\omega )*P(\omega \mid e).$ |

The expected number of broken switches given that light ${{l}}_{{\mathrm{1}}}$ is not lit is given by

$${\mathcal{E}}{}{(}{n}{}{u}{}{m}{}{b}{}{e}{}{r}{}{\mathrm{\_}}{}{o}{}{f}{}{\mathrm{\_}}{}{b}{}{r}{}{o}{}{k}{}{e}{}{n}{}{\mathrm{\_}}{}{s}{}{w}{}{i}{}{t}{}{c}{}{h}{}{e}{}{s}{\mid}{\mathrm{\neg}}{}{l}{}{i}{}{t}{}{(}{{l}}_{{1}}{)}{)}{.}$$ |

This is obtained by averaging the number of broken switches over all of the worlds in which light ${{l}}_{{\mathrm{1}}}$ is not lit.

If a variable is Boolean, with $true$ represented as 1 and $false$ as 0, the expected value is the probability of the variable. Thus any algorithms for expected values can also be used to compute probabilities, and any theorems about expected values are also directly applicable to probabilities.