Expected number of ones before the first 2

77 Views Asked by At

Let $(X_i)_{i\geq1}$ be a sequence of iid. random variables with

$$P(X_i=1)=p_1, P(X_i=2)=p_2, P(X_i=3)=p_3$$

and $p_1+p_2+p_3=1$.

We want to compute the expectation of the random number of 1s in a sample before the first 2 appears.

Let's call this random number $T$.

I found the solution using first step analysis:

$$E(T)=p_1\cdot(E(T)+1)+p_2\cdot 0+p_3\cdot E(T)\Leftrightarrow E(T)=\frac{p_1}{p_2}.$$

In class we discussed the following approach, but couldn't come to a conclusion. Let $N_2$ be the first time a 2 appears. Then

$$T=\sum_{k=1}^{N_2}1_{X_i=1}$$

where $1_{X_i=1}$ is the indicator function of the event, that $X_i$ takes the value 1.

If I slap the expectation onto both sides, i should be able to use the Wald-Identity (a priori without checking the assumptions for it). Then

$$E(T)=E(N_2)P(X_i=1)$$

$N_2$ is geometric with parameter $p_2$, so $E(N_2)=\frac{1}{p_2}$ and $P(X_i=1)=p_1$.

Although this gives the right solution, i don't see the independence of $N_2$ and $1_{X_i=1}$.

Is there a way to show this without the optimal stopping theorem?

1

There are 1 best solutions below

2
On

I finally got it. One can prove it directly, no Wald Identity needed explicitly.

$$E\left(\left.\sum_{i=1}^{N_2-1}1_{X_i=1}\right|N_2=k\right)=\sum_{i=1}^{k-1}E(1_{X_i=1}|N_2=k)=(k-1)\cdot P(X_1=1|X_1\neq 2).$$

Indeed $P(X_1=1,X_1\neq2)=\frac{p_1}{p_1+p_3}$ and $N_2$ ist geometric with parameter $p_2$, so $E(N_2)=\frac1{p_2}.$

So, $$E\left(\left.\sum_{i=1}^{N_2-1}1_{X_i=1}\right|N_2\right)=(N_2-1)\cdot \frac{p_1}{p_1+p_3}=\frac{p_1}{p_2}$$