# Probability/Properties of Distributions

## Introduction

Recall that pdf (or cdf) describes the random behaviour of a random variable completely . However, we may sometimes find the pdf (or cdf) to be too complicated, and only want to know some partial information about the random variable. In view of this, we study some properties of distributions in this chapter, which provide partial descriptions of the random behaviour of the random variable.

Some examples of such partial descriptions include

• location (e.g. pdf is 'located' at left or right?),
• dispersion (e.g. 'sharp' of 'flat' pdf?),
• skewness (e.g. pdf is symmetric, skewed to left, or skewed to right?), and
• tail property (e.g. pdf have 'light' or 'heavy' tails?).

We can qualitatively describe them, but such descriptions are quite subjective and inaccurate. To give a more objective and accurate measure to such descriptions, we evaluate them quantitatively using some quantitative measures derived from the pdf (or cdf) of the random variable.

We will discuss some of such quantitative measures in this chapter. Among these, the expectation is the most important one, since many of other properties base upon the concept of expectation.

## Expectation

We have different alternative names for expectation, e.g. expected value and mean.

Definition. (Expectation) The expectation of a random variable ${\displaystyle X}$  is

(i) (if ${\displaystyle X}$  is discrete)

${\displaystyle \mathbb {E} [X]=\sum _{x\in \operatorname {supp} (X)}^{}x\mathbb {P} (X=x)=\sum _{x\in \operatorname {supp} (X)}^{}x\underbrace {f(x)} _{\text{pmf}}}$

in which ${\displaystyle f}$  is pmf of ${\displaystyle X}$ ;

(ii) (if ${\displaystyle X}$  is continuous)

${\displaystyle \mathbb {E} [X]=\int _{-\infty }^{\infty }x\underbrace {f(x)} _{\text{pdf}}\,dx}$

in which ${\displaystyle f}$  is pdf of ${\displaystyle X}$ ;

(iii) (if ${\displaystyle X}$  is mixed) If

${\displaystyle X={\begin{cases}{\text{discrete random variable}}\;V\;{\text{with probability}}\;\alpha ,\\{\text{continuous random variable}}\;W\;{\text{with probability}}\;1-\alpha ,\end{cases}}}$

${\displaystyle \mathbb {E} [X]=\alpha \mathbb {E} [V]+(1-\alpha )\mathbb {E} [W]=\alpha \sum _{u\in \operatorname {supp} (X)}^{}v\underbrace {f_{V}(v)} _{\text{pmf}}+(1-\alpha )\int _{-\infty }^{\infty }w\underbrace {f_{W}(w)} _{\text{pdf}}\,dw,}$

in which ${\displaystyle f_{V}}$  is pmf of ${\displaystyle V}$  and ${\displaystyle f_{W}}$  is pdf of ${\displaystyle W}$ .

Remark.

• The expectation of ${\displaystyle X}$  is what we would expect of its value if we are to take an observation of ${\displaystyle X}$ .
• It is a weighted average of all possible values attainable by ${\displaystyle X}$  (i.e. ${\displaystyle \operatorname {supp} (X)}$ ), with heavier weighting to points with higher value of pmf or pdf.
• Expectation tells us the 'centre' of distribution of ${\displaystyle X}$ , and 'average' position of ${\displaystyle X}$  when generated in the long run.
• Actually the '${\displaystyle \in \operatorname {supp} (X)}$ ' is not needed, since the pmf or pdf will equal zero for input outside its support.

Example. Let ${\displaystyle X}$  be the number facing up after throwing a fair six-faced dice once. Then, the expectation of ${\displaystyle X}$  is

${\displaystyle \mathbb {E} [X]=1[\underbrace {\mathbb {P} (X=1)} _{1/6}]+2[\underbrace {\mathbb {P} (X=2)} _{1/6}]+\cdots +6[\underbrace {\mathbb {P} (X=6)} _{1/6}]=3.5.}$

If the dice is loaded, and thus the probability that number '6' faces up becomes 0.5, and there are equal probability for the other five numbers facing up, the expectation of ${\displaystyle X}$  becomes
${\displaystyle \mathbb {E} [X]=1[\underbrace {\mathbb {P} (X=1)} _{0.1}]+2[\underbrace {\mathbb {P} (X=2)} _{0.1}]+\cdots +5[\underbrace {\mathbb {P} (X=5)} _{0.1}]+6[\underbrace {\mathbb {P} (X=6)} _{0.5}]=4.5.}$

Example. (Expectation of uniform distribution) Let ${\displaystyle X\sim {\mathcal {U}}[a,b]}$ , the uniform distribution with parameters ${\displaystyle a}$  and ${\displaystyle b}$ . Then, the pdf of ${\displaystyle X}$  is

${\displaystyle f(x)={\frac {\mathbf {1} \{x\in [a,b]\}}{b-a}},}$

and the expectation of ${\displaystyle X}$  is
${\displaystyle \mathbb {E} [X]=\int _{-\infty }^{\infty }x{\frac {\mathbf {1} \{x\in [a,b]\}}{b-a}}\,dx={\frac {1}{b-a}}\underbrace {\int _{a}^{b}x\,dx} _{b^{2}/2-a^{2}/2}={\frac {b^{2}-a^{2}}{2(b-a)}}={\frac {{\cancel {(b-a)}}(b+a)}{2{\cancel {(b-a)}}}}={\frac {a+b}{2}}.}$

Exercise. In a process, we first toss an unfair coin one time, with probability ${\displaystyle p}$  for the head to come up. If head comes up in the first toss, we toss another unfair coin one time, with probability ${\displaystyle q}$  for the head to come up. If tails comes up in the first toss instead, We throw an arrow to the ground one time. Let ${\displaystyle X}$  be the number of head coming up in all tosses, ${\displaystyle Y}$  be the angle from the north direction to the direction pointed by the arrow, measured clockwise and in radian, and ${\displaystyle Z}$  be the number we get from the process finally. Suppose that ${\displaystyle Y\sim {\mathcal {U}}[0,2\pi )}$ .

1 Choose correct expression(s) of ${\displaystyle \mathbb {E} [X]}$ .

 ${\displaystyle p}$ ${\displaystyle q}$ ${\displaystyle p+q}$ ${\displaystyle (1-p)(1-q)+p(1-q)+q(1-p)+2pq}$ ${\displaystyle 2p(1-q)+2pq}$

2 Choose correct expression(s) of ${\displaystyle \mathbb {E} [Y]}$ .

 ${\displaystyle \pi }$ ${\displaystyle p\pi }$ ${\displaystyle q\pi }$ ${\displaystyle (1-p)\pi }$ ${\displaystyle (1-q)\pi }$

3 Choose correct expression(s) of ${\displaystyle \mathbb {E} [Z]}$ .

 ${\displaystyle pq+(1-p)\pi }$ ${\displaystyle p(p+q)+(1-p)\pi }$ ${\displaystyle pq+(1-p)q\pi }$ ${\displaystyle p(p+q)+(1-p)p\pi }$

4 If the two coins are fair, choose correct statement(s).

 ${\displaystyle \mathbb {E} [Z]}$  increases. ${\displaystyle \mathbb {E} [Z]}$  decreases. Change in ${\displaystyle \mathbb {E} [Z]}$  depends on values of ${\displaystyle p}$  and ${\displaystyle q}$ . ${\displaystyle \mathbb {E} [Y]}$  remains unchanged. ${\displaystyle \mathbb {E} [Z]}$  increases if ${\displaystyle p=q=1/3}$ .

In the following, we introduce a useful result that gives the relationship between expectation and probability, we can use expectation to ease the computation of probability using this result.

Proposition. (Fundamental bridge between probability and expectation) For each event ${\displaystyle E\subseteq \Omega }$ ,

${\displaystyle \mathbb {E} [\mathbf {1} \{E\}]=\mathbb {P} (E).}$

Proof. Let ${\displaystyle X=\mathbf {1} \{E\}}$ . Since ${\displaystyle X=\mathbf {1} \{E\}\sim \operatorname {Ber} (\mathbb {P} (E))}$  (which is a discrete random variable),

${\displaystyle \mathbb {E} [X]=0[\mathbb {P} (X=0)]+1[\mathbb {P} (X=1)]=\mathbb {P} (\mathbf {1} \{E\}=1)=\mathbb {P} (E).}$

${\displaystyle \Box }$

When there are multiple random variables involved, we may derive the joint pmf or pdf first to compute the expectation, but it can be quite difficult and complicated to do so. Practically, we use the following theorem more often.

Theorem. (Law of the unconscious statistician (LOTUS)) Let ${\displaystyle X_{1},\ldots ,X_{n}}$  be random variables. Define ${\displaystyle Y=g(X_{1},\ldots ,X_{n})}$  for a function ${\displaystyle g}$ . Then,

(i) (if ${\displaystyle Y}$  is discrete)

${\displaystyle \mathbb {E} [Y]=\sum _{x_{1}}^{}\cdots \sum _{x_{n}}^{}g(x_{1},\ldots ,x_{n})\underbrace {f(x_{1},\ldots ,x_{n})} _{\text{joint pmf}},}$

in which ${\displaystyle f}$  is joint pmf of ${\displaystyle (X_{1},\ldots ,X_{n})}$ ;

(ii) (if ${\displaystyle Y}$  is continuous)

${\displaystyle \mathbb {E} [Y]=\int _{-\infty }^{\infty }\cdots \int _{-\infty }^{\infty }g(x_{1},\ldots ,x_{n})\underbrace {f(x_{1},\ldots ,x_{n})} _{\text{joint pdf}}\,dx_{1}\cdots \,dx_{n},}$

in which ${\displaystyle f}$  is joint pdf of ${\displaystyle (X_{1},\ldots ,X_{n})}$ .

Remark.

• If ${\displaystyle Y}$  is mixed, we can apply the definition of expectation and use the above two results for the expectations of the discrete and continuous random variables.
• This theorem is known as the law of the unconscious statistician, because we often tend to use this identity without realizing that it is a result of a theorem, instead of a definition.
• This theorem also holds when there is only one random variables involved (the joint pmf and pdf become normal pmf and pdf) , e.g.

${\displaystyle \mathbb {E} [g(X)]=\int _{-\infty }^{\infty }g(x)f(x)\,dx}$

The proof is quite complicated, and hence we skip it. In the following, we will introduce several properties of expectation that can help us to simplify computations of the expectation.

Proposition. (Properties of expectation) For each constant ${\displaystyle \alpha ,\beta ,\gamma }$  and random variable ${\displaystyle X,Y}$ ,

• (Linearity) ${\displaystyle \mathbb {E} [\alpha X+\beta Y+\gamma ]=\alpha \mathbb {E} [X]+\beta \mathbb {E} [Y]+\gamma }$ ;
• (Nonnegativity) if ${\displaystyle X\geq 0}$ , ${\displaystyle \mathbb {E} [X]\geq 0}$ ;
• (Monotonicity) if ${\displaystyle X\geq Y}$ , ${\displaystyle \mathbb {E} [X]\geq \mathbb {E} [Y]}$ ;
• (Triangle inequality) ${\displaystyle |\mathbb {E} [X]|\leq \mathbb {E} [|X|]}$ ;
• (Multiplicativity under independence) if ${\displaystyle X,Y}$  are independent, ${\displaystyle \mathbb {E} [XY]=\mathbb {E} [X]\mathbb {E} [Y]}$ .

Proof.

Linearity:

for continuous random variables ${\displaystyle X,Y}$ ,

{\displaystyle {\begin{aligned}\mathbb {E} [\alpha X+\beta Y+\gamma ]=\int _{-\infty }^{\infty }\int _{-\infty }^{\infty }(\alpha x+\beta y+\gamma )\underbrace {f(x,y)} _{\text{joint pdf}}\,dx\,dy&=\alpha \int _{-\infty }^{\infty }x\underbrace {\int _{-\infty }^{\infty }f(x,y)\,dy} _{{\text{marginal pdf of }}X}\,dx+\beta \int _{-\infty }^{\infty }y\underbrace {\int _{-\infty }^{\infty }f(x,y)\,dx} _{{\text{margianl pdf of }}Y}\,dy+\gamma \underbrace {\int _{-\infty }^{\infty }f(x,y)\,dx\,dy} _{1}\\&=\alpha \underbrace {\int _{-\infty }^{\infty }xf_{X}(x)\,dx} _{\mathbb {E} [X]}+\beta \underbrace {\int _{-\infty }^{\infty }yf_{Y}(y)\,dy} _{\mathbb {E} [Y]}+\gamma \\&=\alpha \mathbb {E} [X]+\beta \mathbb {E} [Y]+\gamma .\end{aligned}}}

Similarly, for discrete random variables ${\displaystyle X,Y}$ ,
{\displaystyle {\begin{aligned}\mathbb {E} [\alpha X+\beta Y+\gamma ]&=\sum _{x}^{}\sum _{y}^{}(\alpha x+\beta y+\gamma )f(x,y)\\&=\alpha \sum _{x}^{}x\sum _{y}^{}f(x,y)+\beta \sum _{y}^{}y\sum _{x}^{}f(x,y)+\gamma \sum _{x}^{}\sum _{y}^{}f(x,y)\\&=\alpha \sum _{x}^{}f_{X}(x)+\beta \sum _{y}^{}f_{Y}(y)+\gamma (1)\\&=\alpha \mathbb {E} [X]+\beta \mathbb {E} [Y]+\gamma .\end{aligned}}}

Nonnegativity:

For continuous random variable ${\displaystyle X}$ ,

${\displaystyle \underbrace {\int _{0}^{\infty }} _{\because X\geq 0}xf_{X}(x)\geq 0.}$

Similarly, for discrete random variable ${\displaystyle X}$ ,
${\displaystyle \underbrace {\sum _{x\geq 0}^{}} _{\because X\geq 0}xf_{X}(x)\geq 0.}$

Monotonicity:

For random variables ${\displaystyle X,Y}$  that are either both discrete or both continuous,

${\displaystyle X\geq Y\Rightarrow X-Y\geq 0\Rightarrow \mathbb {E} [X]-\mathbb {E} [Y]{\overset {\text{linearity}}{=}}\mathbb {E} [X-Y]{\overset {\text{nonnegativity}}{\geq }}0.}$

Triangle inequality:

${\displaystyle -|X|\leq X\leq |X|{\overset {\text{monotonicity}}{\Rightarrow }}-{\color {green}\mathbb {E} [}|X|{\color {green}]}\leq {\color {green}\mathbb {E} [}X{\color {green}]}\leq {\color {green}\mathbb {E} [}|X|{\color {green}]}}$

Multiplicativity under independence:

For continuous random variables ${\displaystyle X,Y}$ ,

${\displaystyle \mathbb {E} [XY]=\int _{-\infty }^{\infty }\int _{-\infty }^{\infty }xy\underbrace {f(x,y)} _{\text{joint pdf}}\,dx\,dy={\color {red}\int _{-\infty }^{\infty }}{\color {blue}\int _{-\infty }^{\infty }x}{\color {red}y}\underbrace {{\color {blue}f_{X}(x)}{\color {red}f_{Y}(y)}} _{\text{marginal pdf's}}{\color {blue}\,dx}{\color {red}\,dy}={\color {red}\int _{-\infty }^{\infty }yf_{Y}(y)}\underbrace {\color {blue}\int _{-\infty }^{\infty }xf_{X}(x)\,dx} _{{\text{independent from }}y}{\color {red}\,dy}={\color {blue}\int _{-\infty }^{\infty }xf_{X}(x)\,dx}{\color {red}\int _{-\infty }^{\infty }yf_{Y}(y)\,dy}=\mathbb {E} [X]\mathbb {E} [Y].}$

Similarly, for discrete random variables ${\displaystyle X,Y}$ ,
${\displaystyle \mathbb {E} [XY]=\sum _{x}^{}\sum _{y}^{}xy\underbrace {f(x,y)} _{\text{joint pmf}}={\color {red}\sum _{y}^{}}{\color {blue}\sum _{x}^{}x}{\color {red}y}\underbrace {{\color {blue}f_{X}(x)}{\color {red}f_{Y}(y)}} _{\text{marginal pmf's}}=\left({\color {blue}\sum _{x}^{}xf_{X}(x)}\right)\left({\color {red}\sum _{y}^{}yf_{Y}(y)}\right)=\mathbb {E} [X]\mathbb {E} [Y].}$

${\displaystyle \Box }$

Remark.

• (Nonmultiplicativity) ${\displaystyle \mathbb {E} [XY]\neq \mathbb {E} [X]\mathbb {E} [Y]}$  in general.
• We cannot apply linearity property similarly when the function inside the expectation is nonlinear. E.g., ${\displaystyle \mathbb {E} [2^{X}]\neq 2^{\mathbb {E} [X]}}$  in general.
• From linearity, we can see that the expectation of a constant is simply the constant itself. This is intuitive, since the value we expect for a constant is simply the constant.
• The converse of multiplicativity under independence is true in general, but not always true. For some special dependent random variables, the converse does not hold.

### Mean of some distributions of a discrete random variable

Proposition. (Mean of Bernoulli and binomial r.v.'s) Let ${\displaystyle X\sim \operatorname {Ber} (p)}$  and ${\displaystyle Y\sim \operatorname {Binom} (n,p)}$ . Then, ${\displaystyle \mathbb {E} [X]=p}$ , and ${\displaystyle \mathbb {E} [Y]=np}$ .

Proof.

• ${\displaystyle \mathbb {E} [X]=\underbrace {0\cdot \mathbb {P} (X=0)} _{=0}+1\cdot \underbrace {\mathbb {P} (X=1)} _{=p}=p}$ .
• Since ${\displaystyle Y=X_{1}+\dotsb +X_{n}}$ , in which ${\displaystyle X_{1},\dotsc ,X_{n}}$  are i.i.d. and follow ${\displaystyle \operatorname {Ber} (p)}$  [1],
• ${\displaystyle \mathbb {E} [Y]=\mathbb {E} [X_{1}+\dotsb +X_{n}]{\overset {\text{ linearity }}{=}}\mathbb {E} [X_{1}]+\dotsb +\mathbb {E} [X_{n}]=\underbrace {p+\dotsb +p} _{n{\text{ times}}}=np}$ .

${\displaystyle \Box }$

Proposition. (Mean of Poisson r.v.'s) Let ${\displaystyle X\sim \operatorname {Pois} (\lambda )}$ . Then, ${\displaystyle \mathbb {E} [X]=\lambda .}$

Proof.

${\displaystyle \mathbb {E} [X]=\sum _{k=0}^{\infty }k\underbrace {\left({\frac {\lambda ^{k}e^{-\lambda }}{k!}}\right)} _{\mathbb {P} (X=k)}=\lambda \left(0+\sum _{\underbrace {\color {blue}k=1} _{k-1=0}}^{\infty }\underbrace {{\cancel {k}}\left({\frac {\lambda ^{k-1}e^{-\lambda }}{{\cancel {k}}(k-1)!}}\right)} _{\mathbb {P} (X=k-1)}\right)=\lambda (0+1)=\lambda .}$

${\displaystyle \Box }$

Proposition. (Mean of geometric and negative binomial r.v.'s) Let ${\displaystyle X\sim \operatorname {Geo} (p)}$  and ${\displaystyle Y\sim \operatorname {NB} (k,p)}$  . Then, ${\displaystyle \mathbb {E} [X]={\frac {1-p}{p}}}$ , and ${\displaystyle \mathbb {E} [Y]={\frac {k(1-p)}{p}}}$ .

Proof.

• Since

{\displaystyle {\begin{aligned}\mathbb {E} [X]&=\sum _{k=0}^{\infty }k\underbrace {(1-p)^{k}p} _{\mathbb {P} (X=k)}\\&=\sum _{k=0}^{\infty }(k-1)(1-p)^{k}p+\overbrace {\sum _{k=0}^{\infty }\underbrace {(1-p)^{k}p} _{\mathbb {P} (X=k)}} ^{=1}\\&=\underbrace {\color {blue}(0-1)(1-p)^{0}p} _{=-p}+\left((1-p)\sum _{\color {blue}k-1=0}^{\infty }(k-1)(1-p)^{k-1}p\right)+1\\&=-p+(1-p)\mathbb {E} [X]+1,\\\end{aligned}}}

• it follows that ${\displaystyle \;p\mathbb {E} [X]=1-p\Rightarrow \mathbb {E} [X]={\frac {1-p}{p}}.}$ .
• Since ${\displaystyle Y=X_{1}+\dotsb +X_{k}}$  in which ${\displaystyle X_{1},\dotsc ,X_{k}}$  are i.i.d., and follow ${\displaystyle \operatorname {Geo} (p)}$  [2],
• ${\displaystyle \mathbb {E} [Y]=\mathbb {E} [X_{1}]+\dotsb +\mathbb {E} [X_{k}]=\underbrace {{\frac {1-p}{p}}+\dotsb +{\frac {1-p}{p}}} _{k{\text{ times}}}={\frac {k(1-p)}{p}}.}$

${\displaystyle \Box }$

Proposition. (Mean of hypergeometric r.v.'s) Let ${\displaystyle X\sim \operatorname {HypGeo} (N,K,n)}$ . Then, ${\displaystyle \mathbb {E} [X]=nK/N}$ .

Proof.

• Since ${\displaystyle X=X_{1}+\dotsb +X_{n}}$  in which ${\displaystyle X_{1},\dotsc ,X_{n}\sim \operatorname {Ber} (K/N)}$  (each of the Bernoulli r.v.'s indicates whether the corresponding draw of ball is of type 1, with probability ${\displaystyle K/N}$  without knowing the results of other draws [3], since each draw is equally likely to be any of the ${\displaystyle N}$  balls) [4] ,
• it follows that ${\displaystyle \mathbb {E} [X]=\mathbb {E} [X_{1}]+\dotsb +\mathbb {E} [X_{n}]=\underbrace {{\frac {K}{N}}+\dotsb +{\frac {K}{N}}} _{n{\text{ times}}}={\frac {nK}{N}}.}$

${\displaystyle \Box }$

### Mean of some distributions of a continuous random variable

We will introduce the formulas for mean of some distributions of a continuous random variable, which are relatively simpler.

Proposition. (Mean of uniform r.v.'s) Let ${\displaystyle X\sim {\mathcal {U}}[a,b]}$  (${\displaystyle a ). Then, ${\displaystyle \mathbb {E} [X]={\frac {a+b}{2}}}$ .

Proof.

${\displaystyle \mathbb {E} [X]=\int _{a}^{b}{\frac {x}{b-a}}\,dx={\frac {1}{2(b-a)}}(b^{2}-a^{2})={\frac {{\cancel {(b-a)}}(b+a)}{2{\cancel {(b-a)}}}}.}$

${\displaystyle \Box }$

Proposition. (Mean of gamma, exponential, and chi-squared r.v.'s) Let ${\displaystyle X\sim \operatorname {Gamma} (\alpha ,\lambda )}$ , ${\displaystyle Y\sim \operatorname {Exp} (\lambda )}$ , and ${\displaystyle Z\sim \chi _{\nu }^{2}}$ . Then, ${\displaystyle \mathbb {E} [X]=\alpha /\lambda }$ , ${\displaystyle \mathbb {E} [Y]=1/\lambda }$ , and ${\displaystyle \mathbb {E} [Z]=\nu }$ .

Proof.

• It suffices to prove the formula for mean of gamma r.v.'s, since exponential and chi-squared r.v.'s are essentially special cases of gamma r.v.'s, and thus we can simply substitute some values into the formula for mean of gamma r.v.'s to obtain the formulas for them.
• {\displaystyle {\begin{aligned}\mathbb {E} [X]&=\int _{0}^{\infty }{\color {red}x}\cdot {\frac {\lambda ^{\alpha }x^{\alpha -1}e^{-\lambda x}}{\Gamma (\alpha )}}\,dx\\&={\frac {\color {purple}\alpha }{\color {blue}\lambda }}\underbrace {\int _{0}^{\infty }{\frac {\lambda ^{\alpha {\color {blue}+1}}x^{\alpha {\color {red}+1}-1}e^{-\lambda x}}{\Gamma (\alpha {\color {purple}+1})}}\,dx} _{=F(\infty )=1},&F{\text{ is the cdf of }}\operatorname {Gamma} (\alpha +1,\lambda ),\\&={\frac {\alpha }{\lambda }}.\\\end{aligned}}}

• Since ${\displaystyle \operatorname {Exp} (\lambda )\equiv \operatorname {Gamma} (1,\lambda )}$ , ${\displaystyle \mathbb {E} [Y]=1/\lambda }$  by substituting ${\displaystyle \alpha =1}$ .
• Since ${\displaystyle \chi _{\nu }^{2}\equiv \operatorname {Gamma} (\nu /2,1/2)}$ , ${\displaystyle \mathbb {E} [Z]=(\nu {\cancel {/2}})/{\cancel {(1/2)}}=\nu }$  by substituting ${\displaystyle \alpha =\nu /2}$  and ${\displaystyle \lambda =1/2}$ .

${\displaystyle \Box }$

Proposition. (Mean of beta r.v.'s) Let ${\displaystyle X\sim \operatorname {Beta} (\alpha ,\beta )}$ . Then, ${\displaystyle \mathbb {E} [X]={\frac {\alpha }{\alpha +\beta }}}$ .

Proof.

• We use similar approach from the previous proof.

{\displaystyle {\begin{aligned}\mathbb {E} [X]&=\int _{0}^{1}{\color {red}x}\cdot {\frac {\Gamma (\alpha +\beta )}{\Gamma (\alpha )\Gamma (\beta )}}x^{\alpha -1}(1-x)^{\beta -1}\,dx\\&={\frac {\color {purple}\alpha }{\color {blue}\alpha +\beta }}\underbrace {\int _{0}^{1}{\frac {\Gamma (\alpha +\beta {\color {blue}+1})}{\Gamma (\alpha {\color {purple}+1})\Gamma (\beta )}}x^{\alpha {\color {red}+1}-1}(1-x)^{\beta -1}\,dx} _{F(1)=1},&F{\text{ is the cdf of }}\operatorname {Beta} (\alpha +1,\beta ),\\&={\frac {\alpha }{\alpha +\beta }}.\end{aligned}}}

${\displaystyle \Box }$

Proposition. (Undefined mean of Cauchy r.v.'s) Let ${\displaystyle X\sim \operatorname {Cauchy} (\theta )}$ . Then, ${\displaystyle \mathbb {E} [X]}$  is undefined.

Proof.

{\displaystyle {\begin{aligned}\mathbb {E} [X]&=\mathbb {E} [X{\color {blue}-\theta }]{\color {blue}+\theta }&{\text{by linearity}},\\&=\theta +{\frac {1}{\pi }}\int _{-\infty }^{\infty }(x-\theta )\cdot {\frac {1}{1+(x-\theta )^{2}}}\,dx\\&=\theta +{\frac {1}{\pi }}\int _{-\infty }^{\infty }{\frac {u}{1+u^{2}}}\,du,&{\text{let }}u=x-\theta \Rightarrow du=dx,\\&=\theta +{\frac {1}{\pi }}\left(\int _{-\infty }^{0}{\frac {u}{1+u^{2}}}\,du+\int _{0}^{\infty }{\frac {u}{1+u^{2}}}\,du\right)\\&=\theta +{\frac {1}{\pi }}\left({\frac {1}{2}}[\ln(1+u^{2})]_{u=-\infty }^{u=0}+{\frac {1}{2}}[\ln(1+u^{2})]_{u=0}^{u=\infty }\right)\\&=\theta +{\frac {1}{\pi }}(\underbrace {-\infty +\infty } _{\text{undefined}}).\end{aligned}}}

${\displaystyle \Box }$

Proposition. (Mean of normal r.v.'s) Let ${\displaystyle X\sim {\mathcal {N}}(\mu ,\sigma ^{2})}$ . Then, ${\displaystyle \mathbb {E} [X]=\mu }$ .

Proof.

• Let ${\displaystyle Z={\frac {X-\mu }{\sigma }}\sim {\mathcal {N}}(0,1)}$ .
• {\displaystyle {\begin{aligned}\mathbb {E} [Z]&=\int _{-\infty }^{\infty }x\varphi (x)\,dx\\&={\frac {1}{\sqrt {2\pi }}}\int _{-\infty }^{\infty }xe^{-x^{2}/2}\,dx\\&=-{\frac {1}{\sqrt {2\pi }}}\int _{-\infty }^{-\infty }e^{u}\,du,&{\text{let }}u=-{\frac {x^{2}}{2}}\Rightarrow du=-dx\\&=-{\frac {1}{\sqrt {2\pi }}}(\underbrace {e^{-\infty }} _{=0}-\underbrace {e^{-\infty }} _{=0})\\&=0.\end{aligned}}}

• It follows that ${\displaystyle \mathbb {E} [X]=\mathbb {E} [\sigma Z+\mu ]=\sigma \underbrace {\mathbb {E} [Z]} _{=0}+\mu =\mu }$ .

${\displaystyle \Box }$

### Examples

Example. (St. Petersburg Paradox) Consider a game in which the player toss a fair coin ${\displaystyle X}$  times, until a head comes up. Since ${\displaystyle X-1\sim \operatorname {Geo} (1/2)}$ , the expected value of ${\displaystyle X-1}$  is

${\displaystyle \underbrace {\mathbb {E} [X-1]} _{\mathbb {E} [X]-1}={\frac {1-1/2}{1/2}}\Rightarrow \mathbb {E} [X]=1+1={\color {green}2}.}$

That is, the player requires two tosses to get a head coming up on average.

The game rewards the player ${\displaystyle \8}$  to play the game, but the player must pay back ${\displaystyle \2^{X}}$  after getting a head coming up.

Some may think that the expected net gain of the player is

${\displaystyle \8-\2^{\color {green}2}=\4,}$

so the player has an advantage in this game.

However, this is wrong since the correct expected net gain is instead

${\displaystyle \mathbb {E} \left[8-2^{X}\right]{\overset {\text{linearity}}{=}}8-\mathbb {E} \left[2^{X}\right]=8-\sum _{x=1}^{\infty }[2^{x}\cdot \underbrace {(1/2)^{x-1}(1/2)} _{{\text{pdf of }}X}]=8-\sum _{x=1}^{\infty }1=-\infty ,}$

i.e., on average the player has infinite loss!

Exercise.

1 Choose correct statement(s).

 ${\displaystyle \mathbb {E} [X]\geq 0}$  for each random variable ${\displaystyle X}$ . ${\displaystyle \mathbb {E} [|X|]\geq 0}$  for each random variable ${\displaystyle X}$ . ${\displaystyle |\mathbb {E} [X]|\geq 0}$  for each random variable ${\displaystyle X}$ . ${\displaystyle \mathbb {E} [XYZ]=\mathbb {E} [X]\mathbb {E} [Y]\mathbb {E} [Z]}$  if random variables ${\displaystyle X,Y}$  and ${\displaystyle Z}$  are pairwise independent.

2 Given that ${\displaystyle \mathbb {E} [X]=-k=-\mathbb {E} [Y]}$ , Choose correct expression(s) for ${\displaystyle \mathbb {E} [aX+bY+c]}$ .

 ${\displaystyle a\mathbb {E} [X]+\mathbb {E} [bY+c]}$ ${\displaystyle c\mathbb {E} [(a/c)X+(b/c)Y]+c}$ ${\displaystyle (b-a)k+c}$ ${\displaystyle \mathbb {E} [-ak+bk+c]}$

Let us illustrate the usefulness of fundamental bridge between probability and expectation by giving a proof to inclusion-exclusion using this bridge.

Example. (Proof of inclusion-exclusion formula) Recall that the inclusion-exclusion formula is

For each event ${\displaystyle A_{1},A_{2},\ldots }$  and ${\displaystyle A_{n}}$ ,

${\displaystyle \mathbb {P} (A_{1}\cup A_{2}\cup \cdots \cup A_{n})=\sum _{j=1}^{n}(-1)^{j-1}\sum _{i_{1}

The proof is as follows:

{\displaystyle {\begin{aligned}&&X&=\mathbf {1} \{A_{1}\cup \cdots \cup A_{n}\}\\&&&=1-\mathbf {1} \{A_{1}^{c}\cap \cdots \cap A_{n}^{c}\}\\&&&=1-\mathbf {1} \{A_{1}^{c}\}\cdots \mathbf {1} \{A_{n}^{c}\}\\&&&=1-(1-\mathbf {1} \{A_{1}\})\cdots (1-\mathbf {1} \{A_{n}\})\\&&&=\mathbf {1} \{A_{1}\}+\cdots +\mathbf {1} \{A_{n}\}-(\underbrace {\mathbf {1} \{A_{1}\}\mathbf {1} \{A_{2}\}} _{\mathbf {1} \{A_{1}\cap A_{2}\}}+\cdots +\underbrace {\mathbf {1} \{A_{n-1}\}\mathbf {1} \{A_{n}\}} _{\mathbf {1} \{A_{n-1}\cap A_{n}\}})+(\cdots )-(\cdots )\cdots +(-1)^{n-1}\underbrace {\mathbf {1} \{A_{1}\}\cdots \mathbf {1} \{A_{n}\}} _{\mathbf {1} \{A_{1}\cap \cdots \cap A_{n}\}}\\&&&=\sum _{j=1}^{n}(-1)^{j-1}\sum _{i_{1}<\cdots

${\displaystyle \Box }$

### Probability generating functions

An application of expectation is probability generating functions. As suggested by its name, it can generate probabilities in some sense.

Definition. (Probability generating function) Let ${\displaystyle X}$  be a discrete r.v. with support ${\displaystyle \{0,1,2,\dotsc \}}$ . The probability generating functions of ${\displaystyle X}$  is

${\displaystyle G(y)=\mathbb {E} [y^{X}]=\sum _{x=0}^{\infty }y^{x}\mathbb {P} (X=x).}$

Remark.

• There is also moment generating function, which can generate moments (see next section for the definition) in some sense. We will discuss in the transformation of random variables chapter.
• By taking derivatives of the probability generating function, we can generate probabilities:

${\displaystyle {\frac {1}{k!}}\cdot \left.{\frac {d^{k}}{dy^{k}}}G(y)\right|_{k=0}=\mathbb {P} (X=k).}$

• This can be seen directly by evaluating the derivatives.

## Variance (and standard deviation)

Indeed, variance is a special case of central moment, and is related to moment in some sense.

Definition. (${\displaystyle r}$ th moment) The ${\displaystyle r}$ th moment of a random variable ${\displaystyle X}$  is ${\displaystyle \mathbb {E} [X^{r}]}$ .

Definition. (${\displaystyle r}$ th central moment) The ${\displaystyle r}$ th central moment of a random variable ${\displaystyle X}$  is ${\displaystyle \mathbb {E} {\bigg [}(X-\underbrace {\mathbb {E} [X]} _{\text{constant}})^{r}{\bigg ]}}$ .

Definition. (Variance) The variance of a random variable ${\displaystyle X}$ , denoted by ${\displaystyle \operatorname {Var} (X)}$ , is its 2nd central moment, i.e. ${\displaystyle \mathbb {E} {\bigg [}(X-\underbrace {\mathbb {E} [X]} _{\text{constant}})^{2}{\bigg ]}}$ .

Since ${\displaystyle (X-\mathbb {E} [X])^{2}}$  is the squared deviation of the value of ${\displaystyle X}$  from its mean, in view of the definition of variance, we can see that variance measure the dispersion (or spread) of distribution, since it is what we would expect of the squared deviation if we are to take an observation of the random variable.

Another term which is closed related is standard deviation.

Definition. (Standard deviation) The standard deviation of random variable ${\displaystyle X}$ , usually denoted as ${\displaystyle \sigma }$ , is ${\displaystyle {\sqrt {\operatorname {Var} (X)}}}$  .

Remark.

• the interpretation of standard deviation is similar to that of variance
• standard deviation is also sometimes abbreviated as 's.d.'
• standard deviation of random variable ${\displaystyle X}$  has the same unit as ${\displaystyle X}$ , which is one of its advantage, and one of the reasons to use standard deviation instead of variance to measure dispersion.
• since standard deviation is usually denoted as ${\displaystyle \sigma }$ , it follows that we can denote variance as ${\displaystyle \sigma ^{2}}$ , although it is not as common as the ${\displaystyle \operatorname {Var} (\cdot )}$  notation.

Proposition. (Properties of variance)

• (alternative expression for variance)

${\displaystyle \operatorname {Var} (X)=\mathbb {E} \left[X^{2}\right]-\left(\mathbb {E} [X]\right)^{2}}$

• (invariance under change in location parameter)

${\displaystyle \operatorname {Var} (X+a)=\operatorname {Var} (X)}$

for each constant ${\displaystyle a}$
• (homogeneity of degree two)

${\displaystyle \operatorname {Var} (bX)=b^{2}\operatorname {Var} (X)}$

for each constant ${\displaystyle b}$
• (nonnegativity)

${\displaystyle \operatorname {Var} (X)\geq 0}$

• (zero variance implies non-randomness)

${\displaystyle \operatorname {Var} (X)=0\Rightarrow X={\text{non-random constant}}\Leftrightarrow {\text{there exists a constant }}c{\text{ such that }}\mathbb {P} (X=c)=1}$

${\displaystyle X_{1},\ldots ,X_{n}{\text{ are independent}}\Rightarrow \operatorname {Var} (X_{1}+\cdots +X_{n})=\operatorname {Var} (X_{1})+\cdots +\operatorname {Var} (X_{n})}$

Proof.

• alternative expression for variance:
Let ${\displaystyle \mu =\mathbb {E} [X]}$  for clearer expression.

${\displaystyle \mathbb {E} \left[(X-\mu )^{2}\right]=\mathbb {E} \left[X^{2}-2X\mu +\mu ^{2}\right]=\mathbb {E} \left[X^{2}\right]-2\mu \underbrace {\mathbb {E} [X]} _{\mu }+\mu ^{2}=\mathbb {E} \left[X^{2}\right]-\mu ^{2},}$

and the result follows.
• invariance under change in location parameter:

${\displaystyle \operatorname {Var} (X+a)=\mathbb {E} {\bigg [}(X{\cancel {+a}}-\underbrace {\mathbb {E} [X+a]} _{\mathbb {E} [X]{\cancel {+a}}})^{2}{\bigg ]}=\mathbb {E} \left[(X-\mathbb {E} [X])^{2}\right]=\operatorname {Var} (X).}$

• nonnegativity: it follows from ${\displaystyle (X-\mathbb {E} [X])^{2}\geq 0}$ .
• zero variance implies non-randomness:
Let ${\displaystyle \mu =\mathbb {E} [X]}$  for clearer expression. Consider the event ${\displaystyle E_{n}=\{|X-\mu |\geq n^{-1}\}}$ , in which ${\displaystyle n}$  is a positive integer.
Since
${\displaystyle 0=\operatorname {Var} (X)=\mathbb {E} \left[(X-\mu )^{2}\right]\geq \mathbb {E} [(X-\mu )^{2}\underbrace {\mathbf {1} \{E_{n}\}} _{\leq 1}]=\mathbb {E} \left[|X-a|^{2}\mathbf {1} \{E_{n}\}\right]\geq \mathbb {E} [\underbrace {n^{-2}} _{\text{constant}}\mathbf {1} \{E_{n}\}]=\underbrace {n^{-2}} _{\geq 0}\underbrace {\mathbb {P} (E_{n})} _{\geq 0}\geq 0,}$

we have ${\displaystyle 0\geq n^{-2}\mathbb {P} (E_{n})\geq 0\Rightarrow 0\geq \mathbb {P} (E_{n})\geq 0\Rightarrow \mathbb {P} (E_{n})=0}$ .
Thus,

${\displaystyle \mathbb {P} (\underbrace {|X-\mu |>0} _{X\neq \mu })=\mathbb {P} \left(\bigcup _{n=1}^{\infty }E_{n}\right){\overset {\text{a lemma}}{=}}\lim _{n\to \infty }\underbrace {\mathbb {P} (E_{n})} _{0}=0\Rightarrow \mathbb {P} (X=\mu )=1-\underbrace {\mathbb {P} (X\neq \mu )} _{0}=1}$

For each random variable ${\displaystyle X}$  and ${\displaystyle Y}$  that are independent with means ${\displaystyle \mu ,\nu }$  respectively,

{\displaystyle {\begin{aligned}\operatorname {Var} (X+Y)&=\mathbb {E} \left[(X+Y-\mathbb {E} [X+Y])^{2}\right]\\\operatorname {Var} (X+Y)&=\mathbb {E} \left[(X+Y-\mu -\nu )^{2}\right]&{\text{by linearity}}\\&=\underbrace {\mathbb {E} \left[(X-\mu )^{2}\right]} _{\operatorname {Var} (X)}+\underbrace {\mathbb {E} \left[(Y-\nu )^{2}\right]} _{\operatorname {Var} (Y)}+2\mathbb {E} [(X-\mu )(Y-\nu )]&{\text{by linearity}}\\&=\operatorname {Var} (X)+\operatorname {Var} (Y)+2\mathbb {E} [XY]-2\nu \mathbb {E} [X]-2\mu \mathbb {E} [Y]+2\mu \nu &{\text{by linearity}}\\&=\operatorname {Var} (X)+\operatorname {Var} (Y)+2\underbrace {\mathbb {E} [X]\mathbb {E} [Y]} _{\mu \nu }-2\nu \mu {\cancel {-2\mu \nu }}{\cancel {+2\mu \nu }}&{\text{by independence of }}X,Y\\&=\operatorname {Var} (X)+\operatorname {Var} (Y){\cancel {+2\mu \nu }}{\cancel {-2\nu \mu }}\\&=\operatorname {Var} (X)+\operatorname {Var} (Y).\end{aligned}}}

Thus, inductively,
${\displaystyle \operatorname {Var} (X_{1}+\cdots +X_{n})=\operatorname {Var} (X_{1})+\operatorname {Var} (X_{2}+\cdots +X_{n})=\cdots =\operatorname {Var} (X_{1})+\cdots +\operatorname {Var} (X_{n})}$

if ${\displaystyle X_{1},\ldots ,X_{n}}$  are independent.

${\displaystyle \Box }$

### Variance of some distributions of a discrete random variable

Proposition. (Variance of Bernoulli and binomial r.v.'s) Let ${\displaystyle X\sim \operatorname {Ber} (p)}$  and ${\displaystyle Y\sim \operatorname {Binom} (n,p)}$ . Then, ${\displaystyle \operatorname {Var} (X)=p(1-p)}$  and ${\displaystyle \operatorname {Var} (Y)=np(1-p)}$ .

Proof.

• ${\displaystyle \mathbb {E} [X^{2}]=0\cdot \mathbb {P} (X=0)+1\cdot \mathbb {P} (\underbrace {X^{2}=1} _{\Leftrightarrow X=1})=p}$  since ${\displaystyle X}$  is nonnegative.
• It follows that ${\displaystyle \operatorname {Var} (X)=\mathbb {E} [X^{2}]-(\mathbb {E} [X])^{2}=p-p^{2}=p(1-p)}$ .
• Similar to the proof for the mean of Bernoulli and binomial r.v.'s, ${\displaystyle Y=X_{1}+\dotsb +X_{n}}$  in which ${\displaystyle X_{1},\dotsc ,X_{n}}$  are i.i.d. and follow ${\displaystyle \operatorname {Ber} (p)}$ .
• Because of the independence (from i.i.d. property), ${\displaystyle \operatorname {Var} (Y)=\underbrace {\operatorname {Var} (X_{1})+\dotsb +\operatorname {Var} (X_{n})} _{n{\text{ times}}}=np(1-p).}$

${\displaystyle \Box }$

Proposition. (Variance of Poisson r.v.'s) Let ${\displaystyle X\sim \operatorname {Pois} (\lambda )}$ . Then, ${\displaystyle \operatorname {Var} (X)=\lambda }$ .

Proof.

• ${\displaystyle \mathbb {E} [X^{2}]=\sum _{k=0}^{\infty }k^{2}\underbrace {\left({\frac {\lambda ^{k}e^{-\lambda }}{k!}}\right)} _{\mathbb {P} (X=k)}=\lambda \left(0+\sum _{\underbrace {\color {blue}k=1} _{k-1=0}}^{\infty }{\cancel {k}}\left({\frac {k\lambda ^{k-1}e^{-\lambda }}{{\cancel {k}}(k-1)!}}\right)\right)=\lambda \left(\underbrace {\sum _{k-1=0}^{\infty }{\frac {(k{\color {red}-1})e^{-\lambda }\lambda ^{k-1}}{(k-1)!}}} _{\mathbb {E} [X]}+{\color {red}\overbrace {\sum _{k-1=0}^{\infty }\underbrace {\frac {e^{-\lambda }\lambda ^{k-1}}{(k-1)!}} _{\mathbb {P} (X=k-1)}} ^{=1}}\right)=\lambda (\lambda +1).}$

• Hence, ${\displaystyle \operatorname {Var} (X)=\mathbb {E} [X^{2}]-(\mathbb {E} [X])^{2}=\lambda (\lambda +1)-\lambda ^{2}=\lambda .}$

${\displaystyle \Box }$

Proposition. (Variance of geometric and negative binomial r.v.'s) Let ${\displaystyle X\sim \operatorname {Geo} (p)}$  and ${\displaystyle Y\sim \operatorname {NB} (k,p)}$  . Then, ${\displaystyle \operatorname {Var} (X)={\frac {1-p}{p^{2}}}}$ , and ${\displaystyle \mathbb {E} [Y]={\frac {k(1-p)}{p^{2}}}}$ .

Proof.

• Since

{\displaystyle {\begin{aligned}\mathbb {E} [X]&=\sum _{k=0}^{\infty }k^{2}\underbrace {(1-p)^{k}p} _{\mathbb {P} (X=k)}\\&=\sum _{k=0}^{\infty }(k-1+1)^{2}\underbrace {(1-p)^{k}p} _{\mathbb {P} (X=k)}\\&=\sum _{k=0}^{\infty }(k-1)^{2}(1-p)^{k}p+\sum _{k=0}^{\infty }2(k-1)(1-p)^{k}p+\overbrace {\sum _{k=0}^{\infty }\underbrace {(1-p)^{k}p} _{\mathbb {P} (X=k)}} ^{=1}\\&=\underbrace {\color {blue}(0-1)^{2}(1-p)^{0}p} _{=p}+(1-p)\sum _{\color {blue}k-1=0}^{\infty }(k-1)^{2}(1-p)^{k-1}p+\underbrace {\color {red}2(0-1)(1-p)^{0}p} _{=-2p}+2(1-p)\sum _{\color {red}k-1=0}^{\infty }(k-1)(1-p)^{k-1}p+1\\&=p+(1-p)\mathbb {E} [X^{2}]-2p+2(1-p)\underbrace {\mathbb {E} [X]} _{(1-p)/p}+1\\&=(1-p)\mathbb {E} [X^{2}]+{\frac {2(1-p)^{2}}{p}}+1-p,\\\end{aligned}}}

• it follows that ${\displaystyle \;p\mathbb {E} [X^{2}]={\frac {2(1-p)^{2}}{p}}+1-p\Rightarrow \mathbb {E} [X^{2}]={\frac {2(1-p)^{2}+p(1-p)}{p^{2}}}}$ .
• Hence, ${\displaystyle \operatorname {Var} (X)=\mathbb {E} [X^{2}]-(\mathbb {E} [X])^{2}={\frac {2(1-p)^{2}+p(1-p)}{p^{2}}}-{\frac {(1-p)^{2}}{p^{2}}}={\frac {(1-p)^{2}+p(1-p)}{p^{2}}}={\frac {(1-p)(1{\cancel {-p+p}})}{p^{2}}}}$ .
• Similarly, ${\displaystyle Y=X_{1}+\dotsb +X_{k}}$  in which ${\displaystyle X_{1},\dotsc ,X_{k}}$  are i.i.d., and follow ${\displaystyle \operatorname {Geo} (p)}$  [5].
• Because of the independence, ${\displaystyle \operatorname {Var} (Y)=\operatorname {Var} (X_{1})+\dotsb +\operatorname {Var} (X_{k})=\underbrace {{\frac {1-p}{p^{2}}}+\dotsb +{\frac {1-p}{p^{2}}}} _{k{\text{ times}}}={\frac {k(1-p)}{p^{2}}}.}$

${\displaystyle \Box }$

### Variance of some distributions of a continuous random variable

Proposition. (Variance of uniform r.v.'s) Let ${\displaystyle X\sim {\mathcal {U}}[a,b]}$ . (${\displaystyle a ) Then, ${\displaystyle \operatorname {Var} (X)={\frac {(b-a)^{2}}{12}}}$ .

Proof.

{\displaystyle {\begin{aligned}\operatorname {Var} (X)&=\mathbb {E} \left[X^{2}\right]-(\mathbb {E} [X])^{2}\\&=\int _{a}^{b}{\frac {x^{2}}{b-a}}\,dx-\left({\frac {b+a}{2}}\right)^{2}\\&={\frac {1}{b-a}}\left(b^{3}/3-a^{3}/3\right)-\left({\frac {a+b}{2}}\right)^{2}\\&={\frac {1}{3(b-a)}}\left(b^{3}-a^{3}\right)-\left({\frac {a+b}{2}}\right)^{2}\\&={\frac {1}{3{\cancel {(b-a)}}}}{\cancel {(b-a)}}(b^{2}+ba+a^{2})-{\frac {a^{2}+2ab+b^{2}}{4}}\\&={\frac {{\color {blue}{\cancel {4}}}b^{2}{\color {purple}{\cancel {+4ab}}}+{\color {red}{\cancel {4}}}a^{2}{\color {blue}{\cancel {-3b^{2}}}}-{\color {purple}{\overset {2}{\cancel {6}}}}ab{\color {red}{\cancel {-3a^{2}}}}}{12}}\\&={\frac {b^{2}-2ab+a^{2}}{12}}\\&={\frac {(b-a)^{2}}{12}}.\\\end{aligned}}}

${\displaystyle \Box }$

Proposition. (Variance of gamma, exponential and chi-squared r.v.'s) Let ${\displaystyle X\sim \operatorname {Gamma} (\alpha ,\lambda )}$ , ${\displaystyle Y\sim \operatorname {Exp} (\lambda )}$ , and ${\displaystyle Z\sim \chi _{\nu }^{2}}$ . Then, ${\displaystyle \operatorname {Var} (X)=\alpha /\lambda ^{2}}$ , ${\displaystyle \operatorname {Var} (Y)=1/\lambda ^{2}}$ , and ${\displaystyle \operatorname {Var} (Z)=2\nu }$ .

Proof.

• Similarly, it suffices to prove the formula for variance of gamma r.v.'s.
• {\displaystyle {\begin{aligned}\mathbb {E} [X^{2}]&=\int _{0}^{\infty }{\color {red}x^{2}}\cdot {\frac {\lambda ^{\alpha }x^{\alpha -1}e^{-\lambda x}}{\Gamma (\alpha )}}\,dx\\&={\frac {\color {purple}(\alpha +1)\alpha }{\color {blue}\lambda ^{2}}}\underbrace {\int _{0}^{\infty }{\frac {\lambda ^{\alpha {\color {blue}+2}}x^{\alpha {\color {red}+2}-1}e^{-\lambda x}}{\Gamma (\alpha {\color {purple}+2})}}\,dx} _{=F(\infty )=1},&F{\text{ is the cdf of }}\operatorname {Gamma} (\alpha +2,\lambda ),\\&={\frac {(\alpha +1)\alpha }{\lambda ^{2}}}.\\\end{aligned}}}

• It follows that ${\displaystyle \operatorname {Var} (X)=\mathbb {E} [X^{2}]-(\mathbb {E} [X]^{2})={\frac {({\cancel {\alpha }}+1)\alpha }{\lambda ^{2}}}{\cancel {-{\frac {\alpha ^{2}}{\lambda ^{2}}}}}={\frac {\alpha }{\lambda ^{2}}}.}$
• Since ${\displaystyle \operatorname {Exp} (\lambda )\equiv \operatorname {Gamma} (1,\lambda )}$ , ${\displaystyle \operatorname {Var} (Y)=1/\lambda ^{2}}$  by substituting ${\displaystyle \alpha =1}$ .
• Since ${\displaystyle \chi _{\nu }^{2}\equiv \operatorname {Gamma} (\nu /2,1/2)}$ , ${\displaystyle \operatorname {Var} (Z)=(\nu /2)/(1/2)^{2}=2\nu }$  by substituting ${\displaystyle \alpha =\nu /2}$  and ${\displaystyle \lambda =1/2}$ .

${\displaystyle \Box }$

Proposition. (Variance of beta r.v.'s) Let ${\displaystyle X\sim \operatorname {Beta} (\alpha ,\beta )}$ . Then, ${\displaystyle \operatorname {Var} (X)={\frac {\alpha \beta }{(\alpha +\beta )^{2}(\alpha +\beta +1)}}}$ .

Proof.

• {\displaystyle {\begin{aligned}\mathbb {E} [X^{2}]&=\int _{0}^{1}{\color {red}x^{2}}\cdot {\frac {\Gamma (\alpha +\beta )}{\Gamma (\alpha )\Gamma (\beta )}}x^{\alpha -1}(1-x)^{\beta -1}\,dx\\&={\frac {\color {purple}(\alpha +1)\alpha }{\color {blue}(\alpha +\beta +1)(\alpha +\beta )}}\underbrace {\int _{0}^{1}{\frac {\Gamma (\alpha +\beta {\color {blue}+2})}{\Gamma (\alpha {\color {purple}+2})\Gamma (\beta )}}x^{\alpha {\color {red}+2}-1}(1-x)^{\beta -1}\,dx} _{F(1)=1},&F{\text{ is the cdf of }}\operatorname {Beta} (\alpha +2,\beta ),\\&={\frac {(\alpha +1)\alpha }{(\alpha +\beta +1)(\alpha +\beta )}}.\end{aligned}}}

• It follows that
{\displaystyle {\begin{aligned}\operatorname {Var} (X)&=\mathbb {E} [X^{2}]-(\mathbb {E} [X])^{2}={\frac {(\alpha +1)\alpha }{(\alpha +\beta +1)(\alpha +\beta )}}-{\frac {\alpha ^{2}}{(\alpha +\beta )^{2}}}\\&={\frac {(\alpha +1)(\alpha )(\alpha +\beta )-\alpha ^{2}(\alpha +\beta +1)}{(\alpha +\beta )^{2}(\alpha +\beta +1)}}\\&={\frac {\alpha ({\cancel {\alpha ^{2}+\alpha \beta +\alpha }}+\beta {\cancel {-\alpha ^{2}-\alpha \beta -\alpha }})}{(\alpha +\beta )^{2}(\alpha +\beta +1)}}\\&={\frac {\alpha \beta }{(\alpha +\beta )^{2}(\alpha +\beta +1)}}.\\\end{aligned}}}

${\displaystyle \Box }$

Proposition. (Undefined variance of Cauchy r.v.'s) Let ${\displaystyle X\sim \operatorname {Cauchy} (\theta )}$ . Then, ${\displaystyle \operatorname {Var} (X)}$  is undefined.

Proof. It follows from the proposition about undefined mean of Cauchy r.v.'s and the formula ${\displaystyle \operatorname {Var} (X)=\mathbb {E} [X^{2}]-(\mathbb {E} [X])^{2}}$  (arbitrary term minus undefined term is undefined).

${\displaystyle \Box }$

Proposition. (Variance of normal r.v.'s) Let ${\displaystyle X\sim {\mathcal {N}}(\mu ,\sigma ^{2})}$ . Then, ${\displaystyle \operatorname {Var} (X)=\sigma ^{2}}$ .

Proof.

• Let ${\displaystyle Z={\frac {X-\mu }{\sigma }}\sim {\mathcal {N}}(0,1)}$ .
• {\displaystyle {\begin{aligned}\mathbb {E} [Z^{2}]&=\int _{-\infty }^{\infty }x^{2}\varphi (x)\,dx\\&={\frac {1}{\sqrt {2\pi }}}\int _{-\infty }^{\infty }x^{2}e^{-x^{2}/2}\,dx\\&=-{\frac {1}{\sqrt {2\pi }}}\int _{-\infty }^{\infty }xd(e^{-x^{2}/2})\\&=-{\frac {1}{\sqrt {2\pi }}}\left([xe^{-x^{2}/2}]_{-\infty }^{\infty }-\int _{-\infty }^{\infty }e^{-x^{2}/2}\,dx\right)&{\text{by integration by parts}},\\&=-{\frac {1}{\sqrt {2\pi }}}\left(0-0-\int _{-\infty }^{\infty }e^{-x^{2}/2}\,dx\right)&{\text{since exponential function }}\downarrow {\text{ much faster than linear function, or by L'Hospital rule}},\\&=\underbrace {\int _{-\infty }^{\infty }\varphi (x)\,dx} _{=\Phi (\infty )=1}\\&=1.\end{aligned}}}

• It follows that ${\displaystyle \operatorname {Var} (Z)=\mathbb {E} [Z^{2}]-(\mathbb {E} [Z])^{2}=1-0=1}$ .
• Hence, ${\displaystyle \operatorname {Var} (X)=\operatorname {Var} (\sigma Z+\mu )=\sigma ^{2}\operatorname {Var} (Z)=\sigma ^{2}}$ .

${\displaystyle \Box }$

Exercise.

Choose correct statement(s).

 ${\displaystyle \operatorname {Var} (aX)=0\Rightarrow X={\text{non-random constant}}}$  for each constant ${\displaystyle a}$ . ${\displaystyle \operatorname {Var} (aX+b)=a^{2}\operatorname {Var} (X)}$  for each random variable ${\displaystyle X}$ , and for each constant ${\displaystyle a,b}$ . ${\displaystyle \operatorname {Var} (X)=\mathbb {E} [X]\Rightarrow X={\text{non-random constant}}}$ ${\displaystyle \operatorname {Var} (X)\leq 0}$  if ${\displaystyle X\leq 0}$ Standard deviation of random variable ${\displaystyle X}$ , ${\displaystyle \sigma <\operatorname {Var} (X)}$

## Coefficient of variation

Definition. (Coefficient of variation) The coefficient of variation is the ratio of the standard deviation to the mean, i.e. ${\displaystyle \sigma /\mu }$ .

Remark.

• It is also known as relative standard deviation, since it measures the dispersion relatively (relative to the mean).
• Thus, it tells the dispersion more accurately than standard deviation without mean.
• Also, coefficient of variation has no unit.
• So, it is useful to compare dispersion between different data sets.
• It shows the extent of dispersion in relation to the mean.
• However, if the mean is zero, then the coefficient of variation is undefined. So, this is a limitation for it.

Example. If ${\displaystyle \mathbb {E} [X]=10}$  and ${\displaystyle \sigma _{X}=2}$ , then for each ${\displaystyle a\neq 0}$ , the coefficient of variation of ${\displaystyle aX}$  is

${\displaystyle {\frac {\sqrt {\operatorname {Var} (aX)}}{\mathbb {E} [aX]}}={\frac {\sqrt {a^{2}\operatorname {Var} (X)}}{a\mathbb {E} [X]}}={\frac {|a|\operatorname {Var} (X)}{a\mathbb {E} [X]}}={\begin{cases}1/5,\quad a>0;\\-1/5,\quad a<0,\end{cases}}}$

while the coefficient of variation of ${\displaystyle X}$  is 1/5, which equals that of ${\displaystyle aX}$  if ${\displaystyle a>0}$ , equals negative of that of ${\displaystyle aX}$  if ${\displaystyle a<0}$  (they are the same in magnitude, i.e. absolute value). This is expected, since the scaling of random variable itself should not affect the extent of its dispersion.

Exercise.

1 Assume ${\displaystyle \mathbb {E} [X]}$  is increased to 20. Calculate ${\displaystyle \sigma _{X}}$  such that the coefficient of variation of ${\displaystyle X}$  remains unchanged.

 1 2 4 5 8

2 Calculate ${\displaystyle \sigma _{X}}$  such that the standard deviation of ${\displaystyle X}$  remains unchanged.

 1 2 4 5 8

Remark.

• In general, when the mean is negative, then the coefficient of variation will be nonpositive, since standard deviation is always nonnegative.

## Quantile

Then, we will discuss quantile. In particular, median and interqaurtile range are quite related to quantiles.

Definition. (Quantile) Quantile of order ${\displaystyle \alpha }$  (${\displaystyle \alpha }$ th quantile) of random variable ${\displaystyle X}$  is

${\displaystyle F^{-1}(\alpha )=\inf\{x\in \mathbb {R} :F(x)>\alpha \}.}$

Remark.

• Definition of quantile is not unique. There are several alternative definitions, namely

${\displaystyle \inf\{x\in \mathbb {R} :F(x)\geq \alpha \},\sup\{x\in \mathbb {R} :F(x)\leq \alpha \}{\text{ and }}\sup\{x\in \mathbb {R} :F(x)<\alpha \}.}$

• If ${\displaystyle F}$  is strictly increasing, all alternative definitions become equivalent and equal the inverse of cdf at ${\displaystyle \alpha }$  ${\displaystyle F^{-1}(\alpha )}$ , and thus we can calculate the ${\displaystyle \alpha }$ th quantile by solving the equation ${\displaystyle F(x)=\alpha }$  .
• Practical applications focus only on ${\displaystyle \alpha \in (0,1)}$ .

The following are some terminologies related to quantiles.

Definition. (Percentile) The ${\displaystyle (100\alpha )}$ th percentile is ${\displaystyle \alpha }$ th quantile.

Example. 70th percentile is 0.7th quantile.

Definition. (Median) The median is 0.5th quantile.

Definition. (Quartile) The ${\displaystyle j}$ th quartile is ${\displaystyle (j/4)}$ th quantile in which ${\displaystyle j\in \{1,2,3\}}$  .

Example. 2nd quartile is 0.5th quantile, which is also median.

Definition. (Interquartile range) The interquartile range is 3rd quartile minus 1st quartile.

Median and interquartile range measure centrality and dispersion respectively. Recall that mean and variance measure the same things respectively. One advantage of median and interquartile range is robust, since they are always defined, while mean and variance can be infinite, and they fail to measure centrality and dispersion in those occasions. However, median and interquartile range also have some disadvantages, e.g. they may be more difficult to be computed, and may not be very accurate.

Example. (Quantile of uniform distribution) The ${\displaystyle \alpha }$ th quantile of uniform distribution with parameters ${\displaystyle a}$  and ${\displaystyle b>a}$  is

${\displaystyle a+\alpha (b-a),}$

since
${\displaystyle F(x)={\frac {x-a}{b-a}}\mathbf {1} \{a

and we can see that ${\displaystyle x\in (a,b)}$  if ${\displaystyle \alpha \in (0,1)}$ .

Then, median of uniform distribution is

${\displaystyle {\frac {a+b}{2}}}$

which is the same as its mean, and the interquartile range of uniform distribution is
${\displaystyle {\cancel {a}}+(3/4)(b-a){\cancel {-a}}-(1/4)(b-a)={\frac {b-a}{2}},}$

which is different from its variance, namely ${\displaystyle {\frac {(b-a)^{2}}{12}}}$ .

Exercise.

Choose correct statement(s).

 20th quantile is 0.2th percentile 4th quartile is 1st quantile 2nd quantile is undefined. 0th quantile = 0th percentile = 0th quartile. Interquartile range must be nonnegative. Median must be nonnegative.

## Mode

Mode is another measure of centrality.

Definition. (Mode)

• The mode of a pmf (pdf) is the value of ${\displaystyle x}$  at which the pmf (pdf) takes its maximum value (has its local maximum).

Remark.

• The mode is the value that is most likely to be sampled (for pmf).
• Mode is less frequently used than mean.

Example. The modes of the pmf of the numbers coming up from throwing a fair six-faced dice are 1,2,3,4,5 and 6, since the probability for each of these numbers coming up is 1/6, so the pmf takes its maximum value (1/6) at each of these numbers.

Exercise.

Suppose the dice is loaded such that the probability for the number six coming up is 1/2, while other numbers are still equally likely to come up. Which of the following is (are) the mode(s) of the pmf now?

 1 2 3 4 5 6

Remark.

• From this example, we can see that the mode is not necessarily unique.

## Covariance and correlation coefficients

In this section, we will discuss two important properties of joint distributions, namely covariance and correlation coefficients. As we will see, covariance is related to variance in some sense, and correlation coefficient is closed related to correlation.

Definition. (Covariance) For each random variable ${\displaystyle X,Y}$ , the covariance of ${\displaystyle X,Y}$  is

${\displaystyle \operatorname {Cov} (X,Y)=\mathbb {E} [(X-\mathbb {E} [X])(Y-\mathbb {E} [Y])].}$

Definition. (Correlation coefficient) For each random variable ${\displaystyle X,Y}$  such that ${\displaystyle \operatorname {Var} (X),\operatorname {Var} (Y)>0}$ , the correlation coefficient is

${\displaystyle \rho (X,Y)={\frac {\operatorname {Cov} (X,Y)}{\sqrt {\operatorname {Var} (X)\operatorname {Var} (Y)}}}.}$

Both covariance and correlation coefficient measure linear relationship between ${\displaystyle X}$  and ${\displaystyle Y}$ . As we will see, ${\displaystyle \rho (X,Y)\in [-1,1]}$ , ${\displaystyle X,Y}$  are more highly correlated as ${\displaystyle |\rho (X,Y)|}$  increases, and ${\displaystyle X}$  has a linear relationship with ${\displaystyle Y}$  if ${\displaystyle |\rho (X,Y)|=1}$ .

Proposition. (Properties of covariance)

(i) (symmetry) for each random variable ${\displaystyle X,Y}$ ,

${\displaystyle \operatorname {Cov} (X,Y)=\operatorname {Cov} (Y,X)}$

(ii) for each random variable ${\displaystyle X}$ ,
${\displaystyle \operatorname {Cov} (X,X)=\operatorname {Var} (X)}$

(iii) (alternative formula of covariance)
${\displaystyle \operatorname {Cov} (X,Y)=\mathbb {E} [XY]-\mathbb {E} [X]\mathbb {E} [Y]}$

(iv) for each constant ${\displaystyle a_{1},\ldots ,a_{n},b_{1},\ldots ,b_{m},c,d}$ , and for each random variables ${\displaystyle X_{1},\ldots ,X_{n},Y_{1},\ldots ,Y_{m}}$ ,
${\displaystyle \operatorname {Cov} \left(\sum _{i=1}^{n}(a_{i}X_{i}+c),\sum _{j=1}^{m}(b_{j}Y_{j}+d)\right)=\sum _{i=1}^{n}\sum _{j=1}^{m}a_{i}b_{j}\operatorname {Cov} (X_{i},Y_{j})}$

(v) for each random variable ${\displaystyle X_{1},\ldots ,X_{n}}$ ,
${\displaystyle \operatorname {Var} (X_{1}+\cdots +X_{n})=\sum _{i=1}^{n}\operatorname {Var} (X_{i})+2\sum _{1\leq i

Proof.

(i)

${\displaystyle \operatorname {Cov} (X,Y)=\mathbb {E} [(X-\mathbb {E} [X])(Y-\mathbb {E} [Y])]=\mathbb {E} [(Y-\mathbb {E} [Y])(X-\mathbb {E} [X])]=\operatorname {Cov} (Y,X)}$

(ii)
${\displaystyle \operatorname {Cov} (X,X)=\mathbb {E} [(X-\mathbb {E} [X])(X-\mathbb {E} [X])]=\mathbb {E} [(X-\mathbb {E} [X])^{2}]=\operatorname {Var} (X)}$

(iii)
{\displaystyle {\begin{aligned}\operatorname {Cov} (X,Y)&=\mathbb {E} [(X-\mathbb {E} [X])(Y-\mathbb {E} [Y])]\\&=\mathbb {E} [XY-X\mathbb {E} [Y]-Y\mathbb {E} [X]+\mathbb {E} [X]\mathbb {E} [Y]]\\&=\mathbb {E} [XY]-\mathbb {E} [Y]\mathbb {E} [X]{\cancel {-\mathbb {E} [X]\mathbb {E} [Y]+\mathbb {E} [X]\mathbb {E} [Y]}}\qquad {\text{by linearity}}\\&=\mathbb {E} [XY]-\mathbb {E} [X]\mathbb {E} [Y]\end{aligned}}}

(iv)
{\displaystyle {\begin{aligned}\operatorname {Cov} \left(\sum _{i=1}^{n}(a_{i}X_{i}+c),\sum _{j=1}^{m}(b_{j}Y_{j}+d)\right)&=\mathbb {E} \left[\left(\sum _{i=1}^{n}(a_{i}X_{i}+c)-\sum _{i=1}^{n}\mathbb {E} [a_{i}X_{i}+c]\right)\left(\sum _{j=1}^{m}(b_{j}Y_{j}+d)-\sum _{j=1}^{m}\mathbb {E} [b_{j}Y_{j}+d]\right)\right]\\&=\mathbb {E} \left[\sum _{i=1}^{n}(a_{i}X_{i}-\mathbb {E} [a_{i}X_{i}])\sum _{j=1}^{m}(b_{j}Y_{j}-\mathbb {E} [b_{j}Y_{j}])\right]\\&=\mathbb {E} \left[\sum _{i=1}^{n}\sum _{j=1}^{m}(a_{i}X_{i}-\mathbb {E} [a_{i}X_{i}])(b_{j}Y_{j}-\mathbb {E} [b_{j}Y_{j}])\right]\\&=\sum _{i=1}^{n}\sum _{j=1}^{m}\mathbb {E} [(a_{i}X_{i}-a_{i}\mathbb {E} [X_{i}])(b_{j}Y_{j}-b_{j}\mathbb {E} [Y_{j}])]&{\text{by linearity}}\\&=\sum _{i=1}^{n}\sum _{j=1}^{m}a_{i}b_{j}\mathbb {E} [X_{i}-\mathbb {E} [X_{i}]]\mathbb {E} [Y_{j}-\mathbb {E} [Y_{j}]]\\&=\sum _{i=1}^{n}\sum _{j=1}^{m}a_{i}b_{j}\operatorname {Cov} (X_{i},Y_{j})\end{aligned}}}

(v)
{\displaystyle {\begin{aligned}\operatorname {Var} \left(\sum _{i=1}^{n}X_{i}\right)&{\overset {\text{(ii)}}{=}}\operatorname {Cov} \left(\sum _{i=1}^{n}X_{i},\sum _{j=1}^{n}X_{j}\right)\\&{\overset {\text{(iv)}}{=}}\sum _{i=1}^{n}\sum _{j=1}^{n}\operatorname {Cov} (X_{1},X_{j})\\&=\sum _{1\leq i=j\leq n}^{}\operatorname {Cov} (X_{i},X_{j})+\sum _{1\leq i\neq j\leq n}^{}\operatorname {Cov} (X_{i},X_{j})\\&{\overset {\text{(ii)}}{=}}\sum _{i=1}^{n}\operatorname {Var} (X_{i})+\sum _{1\leq i

${\displaystyle \Box }$

Then, we will discuss about correlation coefficients. The following is the definition of correlation between correlation between two random variables.

Definition. (Correlation between two random variables) Random variables ${\displaystyle X,Y}$  are uncorrelated if ${\displaystyle \operatorname {Cov} (X,Y)=0}$ , and are correlated if ${\displaystyle \operatorname {Cov} (X,Y)\neq 0}$

Remark.

• ${\displaystyle \operatorname {Cov} (X,Y)=0\Leftrightarrow \rho (X,Y)=0}$ , and ${\displaystyle \operatorname {Cov} (X,Y)\neq 0\Leftrightarrow \rho (X,Y)\neq 0}$  if ${\displaystyle \operatorname {Var} (X)\neq 0}$  and