Skip to main content

Advanced Probability

1. Tchebychev Inequality

1.1 Statement

Let XDX\sim \mathcal{D} with finite variance σ2\sigma^2 and finite expectation μ.\mu. Then:

rR+,P(Xμrσ)1r2\forall r\in\mathbb{R}_+^*,\quad \mathcal{P}\left(\lvert X-\mu \rvert \ge r\sigma\right) \le \frac{1}{r^2}

1.2 Proof

Let XDX\sim \mathcal{D} with finite variance σ2\sigma^2 and finite expectation μ\mu

Suppose that rR+:\exists r\in\mathbb{R}_+^*:

P(Xμrσ)>1r2\mathcal{P}(\lvert X-\mu \rvert \ge r\sigma)> \frac{1}{r^2}

So we have:

P((Xμ)2r2σ2)>1r2    r2σ2P((Xμ)2r2σ2)>σ2V[X]=E[(Xμ)2]=E[(Xμ)2(Xμ)2r2σ2]P((Xμ)2r2σ2)+E[(Xμ)2(Xμ)2<r2σ2]P((Xμ)2<r2σ2)E[(Xμ)2(Xμ)2r2σ2]P((Xμ)2r2σ2)r2σ2P((Xμ)2r2σ2)>σ2\begin{align*} \mathcal{P}((X-\mu)^2 \ge r^2\sigma^2)&> \frac{1}{r^2}\\ \implies r^2\sigma^2\mathcal{P}((X-\mu)^2 \ge r^2\sigma^2)&> \sigma^2\\ \mathbb{V}[X]&= \mathbb{E}\left[(X-\mu)^2\right]\\ &=\mathbb{E}\left[(X-\mu)^2 \mid (X-\mu)^2 \ge r^2\sigma^2\right]\cdot \mathcal{P}((X-\mu)^2 \ge r^2\sigma^2)\\ &\quad + \mathbb{E}\left[(X-\mu)^2 \mid (X-\mu)^2 < r^2\sigma^2\right]\cdot \mathcal{P}((X-\mu)^2 < r^2\sigma^2) \\ &\ge \mathbb{E}\left[(X-\mu)^2 \mid (X-\mu)^2 \ge r^2\sigma^2\right]\cdot \mathcal{P}((X-\mu)^2 \ge r^2\sigma^2) \\ &\ge r^2\sigma^2\mathcal{P}((X-\mu)^2 \ge r^2\sigma^2) \\ &> \sigma^2 \end{align*}

Which is a contradiction as V[X]=σ2\mathbb{V}[X]=\sigma^2 \quad \blacksquare

2. Discrete Compound Distribution

A discrete compound distribution is a discrete distribution whose parameter is a random variable XX.

For example, if XU(0,1)X\sim U(0,1), B(X)\mathcal{B}(X) is said to be a compound discrete distribution

We will analyse two cases:

  • The random variable XX is discrete
  • The random variable XX is continuous

2.1 Compounding with a discrete random variable

2.1.1 Definition

  • Let D\mathcal{D} a family of distributions with parameter sSs\in S and values on AA
  • Let XX be a discrete distribution with values on QSQ\subseteq S

a discrete random variable YY is said to follow the compound distribution D(X)\mathcal{D}(X) if:

kQ,Y[X=k]D(k)\forall k \in Q, \quad Y[X=k]\sim \mathcal{D}(k)

2.1.2 Probability Mass function

yA,P(Y=y)=kQP(Y=yX=k)P(X=k)=kQP(Y[X=k]=y)P(X=k)\forall y \in A,\quad \mathcal{P}(Y=y)=\sum_{k\in Q}\mathcal{P}(Y=y\mid X=k)\cdot \mathcal{P}(X=k)=\sum_{k\in Q}\mathcal{P}(Y[X=k]=y)\cdot \mathcal{P}(X=k)

2.1.3 Example

  • Let nN,p[0,1]n\in\mathbb{N},p\in[0,1]
  • Let XD(1,n)X\sim \mathcal{D}(1,n)
  • Let YD(1,X).Y\sim \mathcal{D}(1,X). It can be thought as following a Bernoulli distribution with a random size XX

Our goal is to calculate the probability distribution of YY, and then its expected value and variance

We will start by the probability distribution function, as it represents the distribution of YY

k{1,,n},P(Y=k)=s=1nP(Y=kX=s)P(X=s)=1ns=1n1[1,s](k)s=1ns=kn1s\begin{align*} \forall k \in \{1,\dots,n\},\quad \mathcal{P}(Y=k)&=\sum_{s=1}^n\mathcal{P}(Y=k \mid X=s)\mathcal{P}(X=s)\\ &=\frac{1}{n}\sum_{s=1}^n \frac{\mathbb{1}_{[1,s]}(k)}{s} \\ &=\frac{1}{n}\sum_{s=k}^n \frac{1}{s}\\ \end{align*}

For the expected value E[Y]\mathbb{E}[Y], we have:

k{1,,n},E[YX=k]=k+12    E[YX]=X+12    E[Y]=E[E[YX]]=12E[X]+12=n+14+12=n+34\begin{align*} \forall k\in\{1,\dots,n\},\quad \mathbb{E}[Y\mid X=k]&=\frac{k+1}{2}\\ \implies \mathbb{E}[Y\mid X]&=\frac{X+1}{2}\\ \implies \mathbb{E}[Y]&=\mathbb{E}[\mathbb{E}[Y\mid X]] \\ &=\frac{1}{2}\mathbb{E}[X]+\frac{1}{2}\\ &=\frac{n+1}{4}+\frac{1}{2}\\ &=\frac{n+3}{4} \end{align*}

To calculate the variance, we will start by the conditional variance :

k{1,,n},V[YX=k]=k2112    V[YX]=X2112\begin{align*} \forall k\in\{1,\dots,n\},\quad \mathbb{V}[Y\mid X=k]&=\frac{k^2-1}{12}\\ \implies \mathbb{V}[Y\mid X]&=\frac{X^2-1}{12} \end{align*}

Now, we will calculate the variance V[Y]\mathbb{V}[Y] using the theorem of total variance:

V[Y]=V[E[YX]]+E[V[YX]]=V[X+12]+E[X2112]=14V[X]+112E[X2]112=14V[X]+112(V[X]+E[X]2)112=13V[X]+112E[X]2112=n2136+(n+1)248112=4n24+3n2+6n+312144=7n2+6n13144=(n1)(7n+13)144\begin{align*} \mathbb{V}[Y]&=\mathbb{V}[\mathbb{E}[Y\mid X]] + \mathbb{E}[\mathbb{V}[Y\mid X]]\\ &=\mathbb{V}\left[\frac{X+1}{2}\right]+\mathbb{E}\left[\frac{X^2-1}{12}\right] \\ &=\frac{1}{4}\mathbb{V}[X]+\frac{1}{12}\mathbb{E}[X^2]-\frac{1}{12}\\ &=\frac{1}{4}\mathbb{V}[X]+\frac{1}{12}(\mathbb{V}[X]+\mathbb{E}[X]^2)-\frac{1}{12}\\ &=\frac{1}{3}\mathbb{V}[X]+\frac{1}{12}\mathbb{E}[X]^2-\frac{1}{12}\\ &=\frac{n^2-1}{36}+\frac{(n+1)^2}{48}-\frac{1}{12}\\ &=\frac{4n^2-4+3n^2+6n+3-12}{144}\\ &=\frac{7n^2+6n-13}{144}\\ &=\frac{(n-1)(7n+13)}{144} \end{align*}

2.2 Compounding with a continuous random variable

2.2.1 Definition

  • Let D\mathcal{D} a family of distributions with parameter sSs\in S and values on AA
  • Let XX be a continuous distribution with values on QSQ\subseteq S

a discrete random variable YY is said to follow the compound distribution D(X)\mathcal{D}(X) if:

kQ,Y[X=k]D(k)\forall k \in Q, \quad Y[X=k]\sim \mathcal{D}(k)

2.2.2 Probability Mass function

yA,P(Y=y)=QP(Y=yX=t)fX(t) dt=QP(Y[X=t]=y)fX(t) dt\forall y \in A,\quad \mathcal{P}(Y=y)=\int_Q\mathcal{P}(Y=y\mid X=t)\cdot f_X(t)\space \text{dt}=\int_Q\mathcal{P}(Y[X=t]=y)\cdot f_X(t)\space \text{dt}

2.2.3 Example

  • Let nNn\in\mathbb{N}
  • Let XU(0,1)X\sim \mathcal{U}(0,1)
  • Let YB(n,X).Y\sim \mathcal{B}(n,X). It can be thought as following a Bernoulli distribution with a random probability XX

Our goal is to calculate the probability distribution of YY, and then its expected value and variance

We will start by the probability distribution function, as it represents the distribution of YY

k{0,,n},P(Y=k)=01P(Y=kX=p)fX(p) dp=01(nk)pk(1p)nk dp=(nk)B(k+1,nk+1)Where B is the Beta function=(nk)Γ(k+1)Γ(nk+1)Γ(n+2)as B(x,y)=Γ(x)Γ(y)Γ(x+y)=(nk)k!(nk)!(n+1)!=(nk)k!(nk)!(n+1)n!=1n+1    Y follows the discrete uniform distribution D(0,n)\begin{align*} \forall k \in \{0,\dots,n\}, \mathcal{P}(Y=k)&=\int_{0}^1\mathcal{P}(Y=k \mid X=p)\cdot f_X(p)\space \text{dp}\\ &=\int_{0}^{1}{n \choose k}p^k(1-p)^{n-k} \space\text{dp} \\ &={n\choose k}\Beta(k+1,n-k+1) \quad \text{Where}\space \Beta \space \text{is the Beta function}\\ &={n\choose k}\frac{\Gamma(k+1)\Gamma(n-k+1)}{\Gamma(n+2)} \quad \text{as} \space \Beta(x,y)=\frac{\Gamma(x)\Gamma(y)}{\Gamma(x+y)}\\ &={n\choose k}\frac{k!(n-k)!}{(n+1)!}\\ &={n\choose k}\frac{k!(n-k)!}{(n+1)n!}\\ &=\frac{1}{n+1}\\ \implies Y &\space \text{follows the discrete uniform distribution} \space \mathcal{D}(0,n) \end{align*}

The expected value and variance are:

E[X]=n+12V[X]=(n+1)2112=n(n+2)12\begin{align*} \mathbb{E}[X]&=\frac{n+1}{2}\\ \mathbb{V}[X]&=\frac{(n+1)^2-1}{12}\\ &=\frac{n(n+2)}{12} \end{align*}

3. Discrete Compound Distribution

A continuous compound distribution is a discrete distribution whose parameter is a random variable XX.

For example, if XU(0,1)X\sim U(0,1), N(X,1)\mathcal{N}(X,1) is said to be a compound continuous distribution

We will analyse two cases:

  • The random variable XX is discrete
  • The random variable XX is continuous

3.1 Compounding by a discrete distribution

3.1.1 Definition

  • Let D\mathcal{D} a family of distributions with parameter sSs\in S and values on AA
  • Let XX be a discrete distribution with values on QSQ\subseteq S

a continuous random variable YY is said to follow the compound distribution D(X)\mathcal{D}(X) if:

kQ,Y[X=k]D(k)\forall k \in Q, \quad Y[X=k]\sim \mathcal{D}(k)

3.1.2 Probability Mass function

yA,fY(y)=kQfY[X=k](y)P(X=k)\forall y \in A,\quad f_Y(y)=\sum_{k\in Q}f_{Y[X=k]}(y)\cdot \mathcal{P}(X=k)

3.1.3 Example

  • Let p ]0,1]p\in\space ]0,1]
  • Let XG(p)X\sim \mathcal{G}(p)
  • Let YU(0,X).Y\sim \mathcal{U}(0,X). It can be thought as following a uniform distribution with a random parameter XX

Our goal is to calculate the probability distribution of YY, and then its expected value

We will start by the probability distribution function, as it represents the distribution of YY

yR+,fY(y)=nNfY[X=n](y)P(X=n)=nNpn(1p)n11[0,n](y)=n=y+pn(1p)n1\begin{align*} \forall y \in\mathbb{R}^*_+, f_Y(y)&= \sum_{n\in\mathbb{N}^*}f_{Y[X=n]}(y)\mathcal{P}(X=n) \\ &=\sum_{n\in\mathbb{N}^*}\frac{p}{n}(1-p)^{n-1}\mathbb{1}_{[0,n]}(y)\\ &=\sum_{n=\lceil y \rceil}^{+\infty}\frac{p}{n}(1-p)^{n-1} \end{align*}

The expected Value E[Y]\mathbb{E}[Y] is:

E[Y]=R+yfY(y) dy=R+yn=y+pn(1p)n1 dy=mNmm+1n=m+1+ypn(1p)n1dy=mNn=m+1+pn(1p)n1mm+1y dy=mNn=m+1+pn(1p)n1[y22]mm+1=mNn=m+1+pn(1p)n12m+12=nNm=0n1pn(1p)n12m+12=nNp2n(1p)n1m=0n12m+1=nNp2n(1p)n1n2=12nNnp(1p)n1=12E[X]=12p\begin{align*} \mathbb{E}[Y]&=\int_{\mathbb{R}_+}yf_Y(y)\space \text{dy}\\ &=\int_{\mathbb{R}_+}y\sum_{n=\lceil y \rceil}^{+\infty}\frac{p}{n}(1-p)^{n-1} \space \text{dy} \\ &=\sum_{m\in\mathbb{N}}\int_{m}^{m+1}\sum_{n=m+1}^{+\infty}y\frac{p}{n}(1-p)^{n-1} \text{dy} \\ &=\sum_{m\in\mathbb{N}}\sum_{n=m+1}^{+\infty}\frac{p}{n}(1-p)^{n-1}\int_{m}^{m+1}y\space \text{dy}\\ &=\sum_{m\in\mathbb{N}}\sum_{n=m+1}^{+\infty}\frac{p}{n}(1-p)^{n-1}\left[\frac{y^2}{2}\right]^{m+1}_m\\ &=\sum_{m\in\mathbb{N}}\sum_{n=m+1}^{+\infty}\frac{p}{n}(1-p)^{n-1}\frac{2m+1}{2}\\ &=\sum_{n\in\mathbb{N}^*}\sum_{m=0}^{n-1}\frac{p}{n}(1-p)^{n-1}\frac{2m+1}{2}\\ &=\sum_{n\in\mathbb{N}^*}\frac{p}{2n}(1-p)^{n-1}\sum_{m=0}^{n-1}2m+1\\ &=\sum_{n\in\mathbb{N}^*}\frac{p}{2n}(1-p)^{n-1}n^2\\ &=\frac{1}{2}\sum_{n\in\mathbb{N}}np(1-p)^{n-1}\\ &=\frac{1}{2}\mathbb{E}[X]\\ &=\frac{1}{2p} \end{align*}

It can be also calculated directly using the law of total expectation:

E[Y]=E[E[YX]]=nNE[YX=n]P(X=n)=nNn2p(1p)nsince Y[X=n]U(0,n)=12E[X]=12p\begin{align*} \mathbb{E}[Y]&=\mathbb{E}[\mathbb{E}[Y\mid X]] \\ &= \sum_{n\in\mathbb{N}^*}\mathbb{E}[Y\mid X=n]\cdot \mathcal{P}(X=n)\\ &=\sum_{n\in\mathbb{N}^*}\frac{n}{2}p(1-p)^n \quad \text{since } Y[X=n] \sim \mathcal{U}(0,n)\\ &=\frac{1}{2}\mathbb{E}[X]\\ &=\frac{1}{2p} \end{align*}

A third method close to method 2 is to express E[YX]\mathbb{E}[Y\mid X] as a function of XX:

nN,E[YX=n]=n2as Y[X=n]U(0,n)    E[YX]=X2    E[Y]=E[E[YX]]=E[X2]=12E[X]=12p\begin{align*} \forall n\in\mathbb{N}^*,\quad \mathbb{E}[Y\mid X=n]&=\frac{n}{2} \quad \text{as }Y[X=n]\sim\mathcal{U}(0,n)\\ \implies \mathbb{E}[Y\mid X]&=\frac{X}{2}\\ \implies \mathbb{E}[Y]&=\mathbb{E}[\mathbb{E}[Y\mid X]]\\ &=\mathbb{E}\left[\frac{X}{2}\right]\\ &=\frac{1}{2}\mathbb{E}[X]\\ &=\frac{1}{2p} \end{align*}

This example may illustrate how using the right tools can simplify your work and make your engineering life easier 😄

We can go further, and calculate the variance of YY

First of all, we calculate the conditional variance, given XX:

nN,V[YX=n]=n212since Y[X=n]U(0,n)    V[YX]=112X2\begin{align*} \forall n\in\mathbb{N}^*,\quad \mathbb{V}[Y\mid X=n]&=\frac{n^2}{12} \quad \text{since} \space Y[X=n]\sim\mathcal{U}(0,n) \\ \implies \mathbb{V}[Y \mid X]&=\frac{1}{12}X^2 \end{align*}

Now using the law of total variance:

V[Y]=E[V[YX]]+V[E[YX]]=112E[X2]+V[12X]=112V[X]+112E[X]2+14V[X]=13V[X]+112E[X]2=131pp2+112p2=11254pp2\begin{align*} \mathbb{V}[Y]&=\mathbb{E}[\mathbb{V}[Y\mid X]]+\mathbb{V}[\mathbb{E}[Y\mid X]]\\ &= \frac{1}{12}\mathbb{E}[X^2]+\mathbb{V}\left[\frac{1}{2}X\right] \\ &=\frac{1}{12}\mathbb{V}[X]+\frac{1}{12}\mathbb{E}[X]^2+\frac{1}{4}\mathbb{V}[X]\\ &= \frac{1}{3}\mathbb{V}[X]+\frac{1}{12}\mathbb{E}[X]^2\\ &=\frac{1}{3}\cdot\frac{1-p}{p^2}+\frac{1}{12p^2}\\ &=\frac{1}{12}\cdot \frac{5-4p}{p^2} \end{align*}

3.2 Compounding by a continuous distribution

3.2.1 Definition

  • Let D\mathcal{D} a family of distributions with parameter sSs\in S and values on AA
  • Let XX be a continuous distribution with values on QSQ\subseteq S

a discrete random variable YY is said to follow the compound distribution D(X)\mathcal{D}(X) if:

kQ,Y[X=k]D(k)\forall k \in Q, \quad Y[X=k]\sim \mathcal{D}(k)

3.2.2 Probability Mass function

yA,fY(y)=QfY[X=t](y)fX(t) dt\forall y \in A,\quad f_Y(y)=\int_Qf_{Y[X=t]}(y)\cdot f_X(t)\space \text{dt}

3.2.3 Example

  • Let p[0,1]p\in[0,1]
  • Let XU(0,1)X\sim \mathcal{U}(0,1)
  • Let YE(X)Y\sim \mathcal{E}(X) is a compound distribution, it can be thought as following a gamma distribution with random parameter XX

Our goal is to represent the distribution of YY, its expected value and its variance

We will start by the probability distribution function

yR+,fY(y)=RfY[X=t](y)fX(t) dt=01tety dt=[tetyy]01+1y01etydt=eyy+[etyy2]01=eyy+1eyy2=1eyyeyy2=ey1yy2eyfY(0)=01tdt=12\begin{align*} \forall y \in\mathbb{R}^*_+, f_Y(y)&=\int_{\mathbb{R}}f_{Y[X=t]}(y)\cdot f_X(t)\space \text{dt}\\ &=\int_{0}^{1}te^{-ty} \space\text{dt} \\ &=\left[\frac{-te^{-ty}}{y}\right]^{1}_0+\frac{1}{y}\int_0^1e^{-ty}\text{dt} \\ &=\frac{-e^{-y}}{y}+\left[\frac{-e^{-ty}}{y^2}\right]^{1}_0\\ &=\frac{-e^{-y}}{y}+\frac{1-e^{-y}}{y^2}\\ &=\frac{1-e^{-y}-ye^{-y}}{y^2}\\ &=\frac{e^y-1-y}{y^2e^y}\\ f_Y(0)&=\int_{0}^1t\text{dt}\\ &=\frac{1}{2} \end{align*}

For the expected value, we will use the theorem of total expectation:

E[Y]=E[E[YX]]=01E[YX=t]P(X=t)dt=011tdt=+diverges\begin{align*} \mathbb{E}[Y]&=\mathbb{E}[\mathbb{E}[Y\mid X]] \\ &=\int_0^1 \mathbb{E}[Y\mid X=t]\mathcal{P}(X=t)\text{dt}\\ &=\int_0^1\frac{1}{t} \text{dt} =+\infty\quad \text{diverges} \end{align*}

So this probability distribution does not have a mean value, and by extension it does not have a variance.

This example serves as a proof that not all distributions have a mean value and/or a variance

By contrast, the random variable Z=YZ=\sqrt{Y} has a finite mean value, but does not have a variance (if it had one, YY should then have a finite expected value):

E[Z]=E[E[YX]]=01E[YX=t]P(X=t)dt=011tdt=[2t]01=2\begin{align*} \mathbb{E}[Z]&=\mathbb{E}[\mathbb{E}[\sqrt{Y}\mid X]] \\ &=\int_0^1 \mathbb{E}[\sqrt{Y}\mid X=t]\mathcal{P}(X=t)\text{dt}\\ &=\int_0^1\frac{1}{\sqrt{t}} \text{dt} \\ &= \left[2\sqrt{t}\right]^{1}_0\\ &=2 \end{align*}