Mathematical Expectation is the analog for a random variable $X$ of what we would get by drawing a very large number of independent samples from $X$ and computing the samples's empirical average.
Def: If $X$ is a random variable taking values $x_1, x_2, .., x_n ..$, with respective probabilities $P_1,P_2, .., P_n ..$, then $\mathbf{E}[X] = \sum_{i=1}^\infty P_i x_i$
$X=\text{value of a 6-sided die flip}$. Therefore, $x_i=i \ \text{ for }\ i=1,2,3,4,5,6$ and $P_i=\frac{1}{6}$. Thus $\mathbf{E}[X] = \frac{1}{6}. 1 + \frac{1}{6}.2 + ... \frac{1}{6}.6 = \frac{1}{6}(1+2+3+4+5+6)=\frac{21}{6} = 3.5$
Let $X\&Y$ be two random variables, and let $a\&b$ be two constants. Then $\mathbf{E}[aX + bY] = a\mathbf{E}[X] + b\mathbf{E}[Y]$
Let $X\&Y$ be two independent random variables. Thus, $\{X=x_k\}\ \& \ \{Y=y_j\}$ are independent. Then, if $f\&g$ are two functions, we get $\mathbf{E}[f(X)\times g(Y)] = \mathbf{E}[f(X)] \times \mathbf{E}[g(Y)]$
Notation: The pair $(X,Y)$ is a 2-dimensional random variable. We say it is bivariate, and we define its probability mass function $$f_{X,Y}(x_k,y_j) = \mathbf{P}[\{X = x_k\}\cap\{Y=y_j\}]$$
Let $X$ be a non-negative random variable $(X\ge 0; \mathbf{P}[X<0] = 0) $. Then, $\mathbf{P}[X \ge c] \le \mathbf{E}[X]/c$
In practice how to compute the variance from a probability mass function?
Let $c$ be a constant. $X \&X_1\&X_2..X_n$ be independent random variables.
Let $X_1,..X_n$ be $n$ independent & identically distributed ($iid$) random variables. These ccould be samples in an experiment. Let $\bar{X}_n = \frac{X_1 + X_2 + ... X_n}{n}$ (called "Sample mean"). We see that $$\mathbf{E}[\bar{X}_n] = \mu$$ $$\mathbf{Var}[\bar{X}_n] = \frac{n\sigma^2}{n^2} = \frac{\sigma^2}{n}$$
$\hat{\sigma}_n^2 = \frac{1}{n}\sum_{i=1}^n (X_i - \bar{X}_n)^2$ is called "sample variance".
Proof of $\mathbf{E}[\hat{\sigma}_n^2] = \sigma^2 (1 - \frac{1}{n})$
In [ ]: