# Convergence of random variables problem

I am trying to solve the problem from MIT Open Coursware "Statistics for Applications" problem set. Specifically the first one:

"For $$n \in N^*$$, let $$X_n$$ be a random variable such that $$P[X_n = \frac{1}{n}] = 1 - \frac{1}{n^2}$$ and $$P[X_n = n] = \frac{1}{n^2}$$. Does $$X_n$$ converge in probability? In $$L^2$$?"

So as for convergence in probability (from definition) I need to show that $$P[|X_n - X| \geq \varepsilon]$$ converges to 0 as $$n$$ goes to infinity for every $$\varepsilon \gt 0$$.

I am not sure if my approach is correct:

Every random variable $$X_1, X_2, \ldots$$ can have two outcomes. Either $$\frac{1}{n}$$ with probability $$1-\frac{1}{n^2}$$ or $$n$$ with probability $$\frac{1}{n^2}$$.

So as I start to calculate those probabilities for different values of $$n$$ I get:

For $$X_1$$: $$P[X_1 = 1] = 0$$ and $$P[X_1 = 1] = 1$$ (don't know how to understand that)

For $$X_2$$: $$P[X_2 = \frac{1}{2}] = \frac{3}{4}$$ and $$P[X_2=2] = \frac{1}{4}$$

For $$X_3$$: $$P[X_3 = \frac{1}{3}] = \frac{8}{9}$$ and $$P[X_3=3] = \frac{1}{9}$$

and so on...

Now I notice that as n gets larger $$X_n$$ tends to favor $$\frac{1}{n}$$ more and more.

So I choose a random variable $$X$$ such that $$P[X=\frac{1}{n}] = 1$$ which basically means that $$X=\frac{1}{n}$$.

Now plugging everything to the definition of probability convergence:

$$\lim_{n\to\infty} P[|X_n - X| \geq \varepsilon] = \lim_{n\to\infty} P[|X_n - \frac{1}{n}| \geq \varepsilon]$$

Now I can discard the absolute value because for $$n \in N^*$$ $$X_n$$ is either $$n$$ or $$\frac{1}{n}$$ and in this case $$n-\frac{1}{n}$$ and $$\frac{1}{n} - \frac{1}{n}$$ are always greater or equal to 0.

Continuing:

$$\lim_{n\to\infty} P[X_n - \frac{1}{n} \geq \varepsilon]$$

And now this part is a bit tricky - I look what happens in the limit. So as $$n \to \infty$$:

$$P[X_n=\frac{1}{n}] = 1 \;and\; P[X_n=n] = 0$$

Which basically means that $$X_n = \frac{1}{n}$$ as $$n \to \infty$$. So now: $$\lim_{n\to\infty} P[X_n - \frac{1}{n} \geq \varepsilon] = P[0 \geq \varepsilon]$$

Which equals to 0 because $$\varepsilon \gt 0$$. So $$X_n$$ converges in probability.

So my questions are:

1. Is this approach correct? I feel like the beginning is reasonable but at the end it is kind of shady, especially the limit calculation - could it be done in more steps to describe the reasoning better?
2. What would be a formally correct way to prove that $$X_n$$ converges in probability?
3. How to understand that for $$X_1$$ I get $$P[X_1 = 1] = 0$$ and $$P[X_1 = 1] = 1$$?
4. If random variable $$X$$ is such that $$P[X=\frac{1}{n}] = 1$$ is it correct to write $$P[X=\frac{1}{n}] = 1 \Leftrightarrow X=\frac{1}{n}$$?

EDIT: Thanks for all the responses, they really cleared up things for me. I am wondering about convergence in $$L^2$$ - now that we have established that $$X_n$$ converges in probability to 0 can I use that result to prove that it also converges in $$L^2$$?

So now I need to show that $$E[X_n^2]$$ goes to 0 as $$n$$ goes to infinity. So now because I know that $$X_n$$ converges to 0 in probability could I write: $$\lim_{n\to\infty} E[X_n^2] = E[0] = 0$$ ? Or is probability convergence to weak to infer that?

The other soulution would be: $$E[X_n^2] = E[(\frac{1}{n}(1-\frac{1}{n^2}) + n \frac{1}{n^2} )^2 ] = E[( \frac{1}{n} - \frac{1}{n^3} + \frac{1}{n})^2 ] = E[(\frac{2}{n} - \frac{1}{n^3})^2] \xrightarrow[n \to \infty]{} E[0] = 0$$

Is it correct?

EDIT2:

So:

$$Pr[X_n^2 = (\frac{1}{n})^2] = 1-\frac{1}{n^2}$$ and $$Pr[X_n^2=n^2]= \frac{1}{n^2}$$.

Then: $$E[X_n^2]= (\frac{1}{n})^2 (1-\frac{1}{n^2}) + n^2 \frac{1}{n^2} = \frac{1}{n^2} - \frac{1}{n^4} + 1 \xrightarrow[n \to \infty]{} 1$$

So now this means that $$X_n$$ does not converge to 0 in $$L^2$$. Which also means that the previous approach was wrong and probability convergence was to weak.

• add the self-study tag Commented Dec 21, 2019 at 18:36
• Note that $1/n$ is not a constant, so you aren't really "converging to" it. What does $1/n$ itself converge to? Commented Dec 22, 2019 at 1:23
• Right, that's a good point, thanks. Commented Dec 22, 2019 at 17:46

You should let the target distribution be $$Pr[X=0]=1$$.

Let me first work out the CDF of $$X_n$$,

$$Pr(X_n \le \epsilon ) = \begin{cases} 0 &, \epsilon < \frac1n \\ 1-\frac1{n^2} & ,\frac1n \le \epsilon < n \\ 1 &, \epsilon \ge n\end{cases}$$

\begin{align}Pr(|X_n-X|> \epsilon)&=Pr(X_n>\epsilon)\\&=1-Pr(X_n \le \epsilon) \\&= \mathbb{1}_{\epsilon < \frac1n} + \frac1{n^2}\cdot \mathbb{1}_{ \frac1n \le \epsilon < n}\end{align}

Given any $$\epsilon>0$$, for any $$n> \max(\lceil\frac1\epsilon \rceil, \lceil \epsilon\rceil)$$ , we have $$\frac1n \le \epsilon < n$$, and $$Pr(|X_n-X| > \epsilon ) =\frac1{n^2}.$$

Taking the limit of $$n$$ to $$\infty$$ would give you the answer of whether it converges in probability.

You are right regarding $$X_1$$, the intention of the question could be to discuss $$X_n$$ where $$n > 1$$.

We usually write $$X=\frac1n a.s.$$ to denote $$Pr(X=\frac1n)=1$$, a.s. stands for almost surely. That is the set of possible exceptions may be non-empty, but it has probability $$0$$. The concept is essentially analogous to the concept of "almost everywhere" in measure theory.

Edit:

Try to evaluate $$E[X_n^2]$$:

$$E[X_n^2]=\left( \frac1n\right)^2P(X_n=\frac1n)+n^2 P(X_n=n)$$

• Hi, thanks for the explanation, really cleared up a lot of things for me. I expanded the main question to include $L^2$ convergence as well - could you please take a look at it? Commented Dec 23, 2019 at 10:41
• hi, good attempt. So far, you are not evaluating the expectation correctly. can you try to evaluate $E[X_n^2]$ again? Commented Dec 23, 2019 at 12:09
• Thanks, I think the latest solution (EDIT2) is correct now. Another follow up question - so $X_n$ converges in probability to 0. This means it also converges in distribution. So $E[f(X_n)] \xrightarrow[n \to \infty]{} E[f(X)]$ for all continuous and bounded f. So in this case $f(x)=x^2$ so this doesn't apply because $f$ is not bounded? Commented Dec 23, 2019 at 14:00
• yes, you are right, convergence in probability does imply convergence in distribution. Commented Dec 23, 2019 at 14:29