Why $\mathbb{E}[X^2\ |\ X>1]= \mathbb{E}[(1+X)^2]$, where $X$ is a geometric random variable?

64 Views Asked by At

You write a software program over and over, and each time there is probability $p$ that it works correctly, independent of previous attempts. What is the mean and variance of $X$, the number of tries until the program works correctly?

Intermediate steps involve determining $\mathbb{E}[X]$ and $\mathbb{E}[X^2]$, which in turn involve determining $\mathbb{E}[X\ |\ X>1]$ and $\mathbb{E}[X^2\ |\ X>1]$. The reasoning for evaluating $\mathbb{E}[X\ |\ X>1]$ is as follows:

If the first try fails $(X>1)$, we have wasted one try, and we are back where we started. So the expected number of remaining tries is $\mathbb{E}[X]$, and $$\mathbb{E}[X\ |\ X>1] = 1+\mathbb{E}[X]$$

This is pretty clear. But immediately after that,

With similar reasoning, we also have $\mathbb{E}[X^2\ |\ X=1] = 1$ and $$\mathbb{E}[X^2\ |\ X>1] = \mathbb{E}[(1+X)^2]$$

How does "similar reasoning" lead to the second result above? Why not $(1+\mathbb{E}[X])^2$? I can't understand the intuitive justification for this.

1

There are 1 best solutions below

2
On BEST ANSWER

Under condition $X>1$ (so after one failure) the process starts again. The number of trials needed inclusive the first trial that failed is at that moment $1+Y$ where $Y$ has exactly the same distribution as the original random variable $X$. That gives: $$\mathbb E[f(X)\mid X>1]=\mathbb Ef(1+Y)=\mathbb Ef(1+X)$$ for every suitable function $f$.

In your question two such functions show up: $f(x)=x$ and $f(x)=x^2$. $$\mathbb E[X\mid X>1]=\mathbb E[1+Y]=\mathbb E(1+X)=1+\mathbb EX$$

and:

$$\mathbb E[X^2\mid X>1]=\mathbb E(1+Y)^2=\mathbb E(1+X)^2$$

In the first case there is a simplification on base of linearity of expectation.