Expectation  (Iterated)

Let X and Y be two random variables. If Y is being held fixed (Y = y), the expectation of X conditionally to Y = y, denoted E[XY = y], is a number (see here).

Now, if Y is not being held fixed, E[XY = y] becomes a random variable, denoted E[XY ]. The expectation of this r.v. has a very important property expressed by the following formula : 
 

E[X] = E[E[XY]]

 

 

This expression is known as the "Theorem of Iterated Expectation" or "Theorem of double expectation".

It is a compact way to state that :

 or in words :

 

This result has the following graphic interpretation :

 

 

 

    1) The upper image displays p(x, y), the joint probability density function of (X, Y).

    2) p(x, y) is cut into a series of infinitely thin "slices" defined by (y0 , y0 +dy ). Each slice has a barycenter :

    3) The barycenter of p(x, y) is calculated as the barycenter of the barycenters of the slices.

    4) The expectation of X is the projection of the barycenter of p(x, y) on the x axis.

 

These points are formalized in the first Tutorial below.

-----

The Theorem of Iterated Expectation provides an indirect but powerful way of calculating the expectation of a r.v. X  via its coupling with another appropriately chosen "auxiliary" r.v. Y  through the conditional expectation E[XY]. It turns out to be extremely useful in situations where a direct calculation of E[X] is difficult. It can also be used for calculating probabilities, or more complex quantities, like moment generating functions.

____________________________________________________

 

 

Tutorial 1


In the first Tutorial :


 

THEOREM OF ITERATED EXPECTATION

AND FIRST EXAMPLES

The Theorem of Iterated Expectation

Direct demonstration

Demonstration by LOTUS

A simple example

The problem

Direct method

Method of iterated expectation

The broken stick problem

TUTORIAL

 ___________________________________________________

 

 

Tutorial 2

 

 In this second Tutorial, we move on to slightly more sophisticated examples.

 

 

MORE EXAMPLES OF APPLICATIONS OF THE

THEOREM OF ITERATED EXPECTATION

Mean of the geometric distribution

Covariance of two modalities of a multinomial distribution

TUTORIAL

_____________________________________________________

 

 

Tutorial 3

 

In the next Tutorial, we address two classical problems that both involve a random number N of independent random variables {Xi}of identical expectations.

    * We first calculate the expectation of the sum of a random number of such variables, with a remarkably simple result.


The same result is obtained here in the special case of iid non negative, integer valued r.v.s by using the properties of the generating function.

    * We then calculate the expectation of the product of a random number of such variables. In general, the result is not in a closed form, but we show that when N is Poisson distributed, then it is in a closed and simple form.

-----

In both cases, the Theorem of iterated expectation will be the cornerstone of the calculation.

 

 

 

EXPECTATIONS OF THE SUM AND OF THE PRODUCT

OF A RANDOM NUMBER OF R.V.

Expectation of the sum of a random number of r.v.s

The problem

Expectation  of the random sum

Expectation of the product of a random number of r.v.s

The problem

Expectation  of the random product

Special case : N is Poisson distributed

TUTORIAL

_______________________________________________________ 

 

 

Tutorial 4

 

So far, we have used the Theorem of Iterated Expectation for the purpose of calculating expectations. But it can also be used for calculating probabilities, as we show now.

 

 

CALCULATING PROBABILITIES WITH

THE THEOREM OF ITERATED EXPECTATION

Expectation and conditional expectation of an indicator variable

Probability of the event {Y < X}

Demonstration

Example : independent exponential r.v.

Probability of the event {X + Y < a}

Demonstration

Example : sum of iid exponential r.v. 

TUTORIAL

____________________________________________________________

 

 

Tutorial 5

 

We now use the Theorem of iterated expectation to calculate moment generating functions (mgf), the next best thing to a complete probability distribution function. More precisely, we are going to revisit the problem of the properties of a random number of r.v. (see here).

We already calculated the expectation of the sum of a random number of r.v.s under the assumption of identical expectations. We are now going to calculate the mgf of this sum under the stronger assumption that the variables are iid (this result will later be used here).

-----

Of course, we will then derive again the expectation of the sum, but we will go one step further as we will also be able to calculate the variance of this sum.

_____________


We calculate here the generating function of a random sum of non-negative, integer-valued random variables.

 

 

MOMENT GENERATING FUNCTION

OF THE SUM OF A RANDOM NUMBER OF  iid R.V.

Moment generating function Φ(t) of the sum of a random number of iid r.v.s

The problem

Notations

Principle of the calculation

Calculating Φ(t )

Mean and variance of the sum of a random number of iid r.v.s

Differentiating the mgf Φ(t )

First derivative

Second derivative

Mean of the sum of a random number of iid r.v.s

Variance of the sum of a random number of iid r.v.s

TUTORIAL

_____________________________________________________________________

 

 

Tutorial 6

 

After this somewhat hefty material, we'll relax a bit with a nice little problem known as the "Miner's problem". We first address a simplified version of the problem :

Again, the easy solution will be to use the Theorem of iterated expectation. That's what we do in this Tutorial.

-----

We'll then generalize the problem, and show that :

are special cases of the general problem.

As was the case when we calculated the mean of the distribution, it will appear that only the memoryless property of the geometric distribution is needed to obtain the result.

 

 

THE MINER'S PROBLEM

Rolling a die until "1" turns up : mgf of the sum of the outcomes

Generalization

Special cases

The "Miner's problem"

Mgf of the geometric distribution

TUTORIAL

 

_______________________________________________________

 

Related readings :

Expectation

Conditional expectation

Conditional variance

Download this Glossary