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.

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.

The problem

Expectation  of the random sum

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

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 i.i.d. exponential r.v. 

TUTORIAL

____________________________________________________________

 

 

Tutorial 5

 

We now use the Theorem of iterated expectation to calculate moment generating functions (m.g.f.), 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. under the assumption of identical expectations. We are now going to calculate the m.g.f. of this sum under the stronger assumption that the variables are i.i.d. (this result will later be used here).

-----

Of course, we will then derive 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.

 

 

MOMENT GENERATING FUNCTION

OF THE SUM OF A RANDOM NUMBER OF  I.I.D. R.V.

Moment generating function F(t) of the sum of a random number of i.i.d. r.v.

The problem

Notations

Principle of the calculation

Calculating F(t )

Mean and variance of the sum of a random number of i.i.d. r.v.

Differentiating the m.g.f. F(t )

First derivative

Second derivative

Mean of the sum of a random number of i.i.d. r.v.

Variance of the sum of a random number of i.i.d. r.v.

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 : m.g.f. of the sum of the outcomes

Generalization

Special cases

The "Miner's problem"

M.g.f. of the geometric distribution

TUTORIAL

 

_______________________________________________________

 

Related readings :

Expectation

Conditional expectation

Conditional variance

Download this Glossary

 

 

Want to contribute to this site ?