Expectation
For a probability space $(\Omega, \mathcal F, \prob)$, a function $$ X: \Omega \to [0, \infty] $$ is a non-negative random variable if $$ \set{X\leq x}\in\mathcal F \quad\forall x\geq 0. $$
Denote $\mathcal F^+$ for the set of all non-negative random variables.
There is a unique map, called the expectation, $$ \expect: \mathcal F^+ \to [0,\infty] $$ satisfying
-
$\expect(1_A) = \prob(A)$ for all $A\in\mathcal F$;
-
$\expect(\lambda X) = \lambda\expect(X)$ for all $\lambda\in[0,\infty)$ and $X\in\mathcal F^+$;
-
$\expect(\sum_n X_n) = \sum_n \expect(X_n)$ for all sequences $(X_n)_{n\in\N}$ in $\mathcal F^+$.
A random variable $X$ is
-
integrable if $\expect|X| < \infty$.
-
square-integrable if $\expect(X^2) < \infty$.
Denote $L'(\prob)$ be the set of integrable random variables.
For an integrable random variable $X\in L'(\prob)$, define $$ \expect(X) = \expect(X^+) - \expect(X^-) $$ where $X^+ = \max\set{X,0}$ and $X^- = \max\set{-X, 0}$.
Properties of expectation:
-
$\expect(X+Y) = \expect(X) + \expect(Y)$ holds for $X,Y\in\mathcal F^+$ (derivation) and also for $X,Y\in L'(\prob)$ (derivation).
-
If $X(\omega)\leq Y(\omega)$ for all $\omega\in\Omega$, then $\expect(X)\leq\expect(Y)$ for both $X,Y\in\mathcal F^+$ and $L'(\prob)$. (Derivation)
-
$\expect(\lambda X) = \lambda \expect(X)$ for all $\lambda\in\R$ and $X,Y\in L'(\prob)$ (derivation).
-
For $X\in\mathcal F^+$ (not $L'(\prob)$), $\expect(X)=0 \iff \prob(X=0)=1$. (Derivation)
For a discrete random variable $X$ taking values $(x_n:n\in\N)$ and a function $f$, $$ \expect\big(f(X)\big) = \sum_n f(x_n)\,\prob(X=x_n) $$ provided that $f$ is non-negative, or $f(X)$ is integrable.
In particular, if $X$ is non-negative or integrable, $$ \expect(X) = \sum_n x_n\, \prob(X=x_n). $$
For independent random variables $X,Y$ and functions $f,g$, $$ \expect\big(f(X) g(Y)\big) = \expect\big(f(X)\big) \expect\big(g(Y)\big) $$ provided that $f,g$ are non-negative, or $f(X),g(Y)$ are integrable.
For non-negative integer-valued random variable $X$, $$ \expect(X) = \fsum n1\infty \prob(X\geq n). $$ Proof
For a general non-negative random variable $X$, $$\expect(X) = \int_0^\infty \prob(X\geq x)\,dx. $$ Proof requiring Fubini's theorem
The expectation of a random variable $\v X=(X_1, X_2, \ldots, X_n)$ in $\R^n$ is obtained by taking expectation of each of the components: $$ \begin{align*} \expect(\v X) = \left(\expect(X_1), \expect(X_2), \ldots, \expect(X_n)\right). \end{align*} $$
For an integrable random variable $X$ having mean $\mu\in\R$, the variance of $X$ is $$ \operatorname{var}(X) = \expect\big((X-\mu)^2\big). $$
Equivalently (derivation), $$ \operatorname{var}(X) = \expect(X^2) - \expect(X)^2. $$
We see that $\expect(X)^2 \leq \expect(X^2)$, so square-integrable implies integrable.
For $X$ integrable discrete with mean $\mu$, $$\operatorname{var}(X) = \sum_n (x_n-\mu)^2\,\prob(X=x_n).$$
The standard deviation of an integrable random variable $X$ is $\sqrt{\operatorname{var}(X)}$.
For square-integrable random variables $X$, $Y$ with means $\mu$, $\nu$, the covariance is defined by $$ \operatorname{cov}(X,Y) = \expect\big((X-\mu)(Y-\nu)\big). $$ (Derivation that $(X-\mu)(Y-\nu)$ is integrable)
Equivalently (derivation), $$ \op{cov}(X,Y) = \expect(XY) - \expect(X)\expect(Y). $$
The correlation of two square-integrable random variables $X,Y$ is $$ \begin{align*} \op{corr}(X,Y) = \frac{\cov(X,Y)}{\sqrt{\var(X)}\sqrt{\var(Y)}}. \end{align*} $$
For square-integrable random variables $X,Y$, $$ \op{var}(X+Y) = \op{var}(X) + 2\op{cov}(X,Y) + \op{var}(Y). $$
If $X,Y$ are independent, then $\op{cov}(X,Y)=0$.
Proof: $\expect(XY) = \expect(X) \expect(Y)$.
For all $A\in\mathcal F$, if $\prob(A) = p$, then $$ \begin{align*} \op{var}(1_A) &= \expect({1_A}^2) - \expect(1_A)^2 \\ &= p - p^2. \end{align*} $$
The variance of a random variable $\v X=(X_1, X_2, \ldots, X_n)$ in $\R^n$ is its covariance matrix $$ \begin{align*} \op{var}(\v X) = (\op{cov}(X_i, X_j))_{i,j=1}^n = \expect\big[ (\v X-\expect(\v X))(\v X-\expect(\v X))^T \big]. \end{align*} $$
For a non-negative of integrable random variable $X$ and an event $B$ of positive probability, define the condition expectation of $X$ given $B$ by $$ \expect(X|B) = \frac{\expect(X1_B)}{\prob(B)}. $$
Given disjoint events $(B_n: n\in\N)$ of positive probabilities such that $\bigcup_n B_n = \Omega$, we have $$ \expect(X) = \sum_n \expect(X|B_n) \prob(B_n). $$