Expected values
The expected value of a function $$H(X)$$ of a random variable $$X$$ is defined as \[E\left[H(X)\right]=\left\{\!\begin{array}{ll} \displaystyle \sum{H(x_i)P(X=x_i)},& X ~ \mbox{discrete}\\ \displaystyle \int H(x)f(x)\,dx,& X ~ \mbox{continuous}\\\end{array}\right.\] Expectation is linear in that the expectation of a linear combination of functions is the same linear combination of expectations. For example, \[E\left[X^2+ \log{X} +1\right] = E\left[X^2\right] + E\left[\log{X}\right] + 1,\] but $$E[\log{X}] \neq log{E[X]}$$ and $$E[1/X] \neq 1/E[X].$$Variance The variance of a random variable is defined as \[Var(X)=E\left[(X-\mu)^2\right]=E\left[X^2\right]-\mu^2\]
Properties:
$$Var(X)\geq 0$$ and is equal to $$0$$ only if $$X$$ is a constant.
$$Var(aX + b) = a^2Var(X)$$, where $$a$$ and $$b$$ are constants.