Given a probability space $(\Omega, \mathcal H, \mathbb P)$ and positive simple random variable $X \in \mathcal H_+$, $$X = \sum_n a_n \boldsymbol 1_{A_n},$$ the *expectation* of $X$ is given by $$\mathbb E[X] = \sum_n a_n \mathbb P(A_n).$$

By the Monotone Class Theorem, every positive random variable is the increasing limit of positive simple random variables. That is, if $X_+ \in \mathcal H_+$ then there exists increasing sequence of simple random variables $(X_n)$ such that $X_n \nearrow X_+$. We use this to define the expectation for positive random variables, and then general random variables using the decomposition of random variables into positive and negative parts.

**Definition:** Suppose $X_n \nearrow X_+$ is a sequence of simple random variables increasing to non-negative random variable $X_+$. Then the *expectation* of $X_+$ is $$\mathbb E[X_+] = \lim \mathbb E[X_n] \in [0, \infty].$$ For random variable $X$, set $X = X_+ – X_-$ be the decomposition of $X$ into positive and negative parts, then if $\mathbb E[X_+]$ and $\mathbb E[X_-]$ are not both infinite we define the *expectation* $\mathbb E[X] = \mathbb E[X_+] – \mathbb E[X_-] \in [-\infty, \infty]$.

The expectation of a random variable is sometimes called the *mean*. A random variable with finite expectation is said to be* integrable*. The set of integrable random variables is denoted $L^1 = L^1(\mathcal H).$ The condition that $X$ is integrable is equivalent to $\mathbb E[|X|] = \mathbb E[X_+] + \mathbb E[X_-] < \infty$. More generally, if $p > 1$ then $$L^p(\mathcal H) = \{ X : \mathbb E[|X|^p] < \infty\}.$$

### Integration

A measure space is a triple $(E, \mathcal E, \mu)$ consisting of a space $E$, a $\sigma$-algebra on $E$ and a measure $\mu$. The analog to expectation in this situation is the *Lebesgue integral*. Everything in this section is just a restatement of expectation in the language of analysis. In this situation, every measurable function $f : E \rightarrow \mathbb R$ can be decomposed into positive and negative parts $f = f_+ – f_-$, and $f_+$ (and $f_-$ are increasing limits of simple measurable functions $f_n \nearrow f_+$.

Each simple function can be written $\varphi = \sum a_m \mathbf 1_{A_m}$ for some (finite number of) real numbers $a_m$ and measurable sets $A_m$. The integral of $\varphi$ with respect to $\mu$ is defined to be $$\int \varphi d\mu = \sum a_m \mu(A_m).$$

If $f_+$ is the increasing limit of simple functions $f_n \nearrow f_+$ then we define $$\int f \, d\mu = \lim \int f_n \, d\mu,$$ and then finally for $f = f_+ – f_-$ we define $$\int f \, d\mu = \int f_+ \, d\mu – \int f_- \, d\mu.$$ Note that $\int f d\mu$ is defined only when $\int |f| d\mu = \int f_+ d\mu + \int f_- d\mu < \infty$.

For $p \geq 1$ we define $L^p(\mu) = \{ f : \int |f|^p d\mu < \infty\}$.