Calculate variance of this law

54 Views Asked by At

Consider $\mathcal{L}(X)=\frac{1}{n}\delta_0+(1-\frac{1}{n})\mu_N$, with $\mu_N=N(\frac{1}{n},1)$. Determine $\mathbb{E}[X^2]$.

My guess was: $$\mathbb{E}[X^2]=\frac{1}{n}\int_\mathbb{R}x^2\cdot\delta_0(dx)+(1-\frac{1}{n})\int_\mathbb{R}x^2\cdot\mu_N(dx)=0+(1-\frac{1}{n})\cdot1$$ However, my answer file says that $\mathbb{E}[X^2]=(1-\frac{1}{n})(1-\frac{1}{n^2})$ Could anyone point out where I made a mistake?

2

There are 2 best solutions below

7
On

Your error (and I recognize that I have done the same an hour ago) is that you have mixed a probability distribution with the sum of two random variables.

This type of probability law is called a mixture of two laws.

In order to understand it (and converge to the short solution given by @drhab), it helps to think to a simulation.

With the classical following functions (as implemented for example in Matlab):

  • function rand, uniform on [0,1];

  • function randn, normal with $m=0,\sigma=1$

this simulation would use an "if" in the following way:

$$\begin{matrix} \text{if rand} \ < \ \dfrac{1}{n}\\ \ \ \ \ X=0\\ \text{else}\\ \ \ X=\dfrac{1}{n}+randn \end{matrix}$$

If you have the habit to work with a software like Matlab, you may know that the expression (rand>1/n) has value 0 or 1 according to the fact that it is false or true (these 0 and 1 are the same time boolean values and numerial values). Thus, the simulation above can be simplified into:

$$X=\underbrace{(rand>\dfrac{1}{n})}_{B}\times\underbrace{(\dfrac{1}{n}+rand)}_N$$

...in full agreement with the product $X=BN$ @drhab has introduced, where $B$ is Bernoulli with parameter $p=1-\dfrac{1}{n}$ (probability of success).

0
On

Let $B$ have Bernouilli distribution with $\mathbb{P}\left(B=1\right)=1-\frac{1}{n}$ and let $N$ have a distribution such that its mean is $\frac{1}{n}$ and its variance is $1$. Note that $B^2=B$.

If $B$ and $N$ are defined on the same probability space and are independent then $X:=BN$ has the distribution mentioned in your question.

We find: $$\mathbb{E}X^{2}=\mathbb{E}B^{2}N^{2}=\mathbb{E}B^{2}\mathbb{E}N^{2}=\mathbb{P}\left(B=1\right)\mathbb{E}N^{2}=\mathbb{P}\left(B=1\right)\left[\text{Var}N+\left(\mathbb{E}N\right)^{2}\right]=\left(1-\frac{1}{n}\right)\left(1+\frac{1}{n^{2}}\right)$$