Writing the expectation in terms of itself: how to make it rigorous?

57 Views Asked by At

There is a simple method that I have used many times to compute the expectation of some stochastic process. It involves writing the expectation in terms of itself and solving the resulting equation. This process is usually much quicker than figuring out the full distribution and computing the expectation from its definition.

Here is an example to illustrate what I mean. Consider a biased coin where $\Pr(H)=p$ and $\Pr(T)=1-p$. We want to know how many times we can expect to toss this coin before we get the first heads.

First, we can compute the expectation from its definition. The probability that it takes exactly $k$ tosses to get the first heads is $\Pr(k) = (1-p)^{k-1}p$, which gives us the full distribution. Now we have:

$$ E_k = \sum_{k=1}^{\infty} k\Pr(k)= \sum_{k=1}^{\infty}k(1-p)^{k-1}p $$

This infinite sum can be computed, but it is not straightforward. The result is $E_k=1/p$.

Now for the simpler method. Consider the first toss. Either we get heads (with probability $p$), in which case we have succeeded with one toss, or we get tails (with probability $1-p$), in which case we have wasted one toss and we're back to where we were before. In the latter case, it will take us another expected number of tosses to get the first heads. So we write:

$$ E_k = p+(1-p)(1+E_k) $$

which immediately gives us $E_k = 1/p$. No sums, no infinities.

It is intuitively clear to me why this method works, but I have never thought hard about what really goes on when I use it: I just hand-wave. Is it possible to make it rigorous? I suspect that there is a subtle application of linearity of expectation at play, but I cannot yet figure out what are the correct random variables to consider.

1

There are 1 best solutions below

0
On BEST ANSWER

This is the Law of iterated expectation, where you condition on cases.

$$\mathbb{E}[X] = \mathbb{E}(\mathbb{E}(X|Y))$$

If $Y$ takes the outcomes $A_1, A_2, \ldots, A_n$, then

$$ \mathbb{E}[X] = \sum_{i=1}^{n}\mathbb{E}[X|A_i]P(A_i)$$

Applied to your example, we get $E_k = 1 \times p + (1 + E_k ) \times (1 - p)$.


It does follow from the linearity of expectation.