Computing expectations by conditioning

In this section we take advantage of a fundamental theorem concerning iterated expectation. Before formalizing the idea, let us illustrate it by a simple example.

Example 8.7 You are lost in an underground mine and stand in front of two tunnels. One of the two tunnels will lead you to the surface after a 5-hour walk; the other one will just lead back where you are now, a 2-hour walk. What is the expected value of the time it will take to resurface?

This depends on how smart you are. You do not know which is the right tunnel, so you have a 50% percent chance of selecting the wrong one; yet, the least you can do is to not repeat the mistake, by marking the tunnel you select first. In this case, the calculation is fairly simple:

images

Here X is the random time to get to the surface, OK denotes the event that you take the right tunnel, and NOK corresponds to the wrong one.

A more interesting case occurs if you are memoryless, i.e., you do not remember the choice you made if you get back to square 1, Apparently, this is a very complicated case, as there is the possibility of infinite cycling. Using conditioning, the calculation is quite easy. The key point is that if you take the right tunnel, after 5 hours you are done. If you take the wrong one, after 2 hours you are get back to the starting point, and the time to surface is random; however, its expectation is exactly the same as in the first trial, due to lack of memory. Formally

images

Solving for E[X], we find

images

Not surprisingly, it should take more time to resurface if you are memoryless.

The example suggests that, when computing expectations, we may analog to the theorem of total probabilities.

THEOREM 8.10 (Law of iterated expectations) The expected value E[Xcan be expressed in terms of the conditional expectation E[X | Yas

images

We should note that the outermost expectation is with respect to Yas E[X | Yis a function of the random variable Y.

PROOF We prove the result only in the case of two discrete random variables X and Y with finite support; X may take values xii = 1,…,k, and Y may take values yjj = 1,…, l. Using the total probability theorem and the fact that the events {Y = yj} are disjoint, we may write

images

Then we may rewrite E[X] as follows:

images

In the proof, we have used the possibility of swapping sums, which is an obvious consequence of commutative property of addition for finite sums; with infinite sums, some more caution should be used.

Example 8.8 In Section 6.5.4 we considered the geometric distribution with parameter p and we have claimed that its expected value is

images

A very straightforward way to obtain this result exploits conditioning on the outcome of the first trial (the reader should recall the physical motivation of this distribution). If the first trial is a success, which occurs with probability p, we have X = 1 because we have just attained our success and we stop the sequence of trials immediately. Otherwise, we have already failed once, and we must try again. However, since experiments are independent, we are just back to square 1, and the expected number of trials to go is the same as before. Formally

images

from which we immediately get E[X] = l/p, which confirms our previous result. The real bonus, though, comes when computing variance. As a preliminary step, we have

images

which yields

images

Then we immediately obtain

images

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *