189
Outline Martingales Naga Venkata Nitesh Tadepalli 1 1 Lane Department of Computer Science and Electrical Engineering West Virginia University 17 April, 2012 Nitesh Randomized Algorithms

Martingales - West Virginia University

  • Upload
    others

  • View
    5

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Martingales - West Virginia University

Outline

Martingales

Naga Venkata Nitesh Tadepalli1

1Lane Department of Computer Science and Electrical EngineeringWest Virginia University

17 April, 2012

Nitesh Randomized Algorithms

Page 2: Martingales - West Virginia University

Outline

Outline

1 MartingalesDefinitionDoob Martingale

2 Stopping TimesIntroductionMartingale Stopping Theorem

3 Wald’s Equation

Nitesh Randomized Algorithms

Page 3: Martingales - West Virginia University

Outline

Outline

1 MartingalesDefinitionDoob Martingale

2 Stopping TimesIntroductionMartingale Stopping Theorem

3 Wald’s Equation

Nitesh Randomized Algorithms

Page 4: Martingales - West Virginia University

Outline

Outline

1 MartingalesDefinitionDoob Martingale

2 Stopping TimesIntroductionMartingale Stopping Theorem

3 Wald’s Equation

Nitesh Randomized Algorithms

Page 5: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

DefinitionDoob Martingale

Outline

1 MartingalesDefinitionDoob Martingale

2 Stopping TimesIntroductionMartingale Stopping Theorem

3 Wald’s Equation

Nitesh Randomized Algorithms

Page 6: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

DefinitionDoob Martingale

Martingales

Definition

A sequence of random variables Z0,Z1, · · · is a martingale with respect to thesequence X0,X1, . . . if, for all n ≥ 0, the following conditions hold:

(i) Zn is a function of X0,X1, . . . ,Xn;

(ii) E[|Zn|] <∞(iii) E[Zn+1 | X0, . . . ,Xn] = Zn

A sequence of random variables Z0,Z1, · · · is called martingale, when it is a martingalewith respect to itself. That is, E[|Zn|] <∞, and E[Zn+1 | Z0, . . . ,Zn] = Zn.

Note

1 A Martingale can have a finite or a countably infinite number of elements.2 The indexing of the martingale sequence does not need to start at 0.

Nitesh Randomized Algorithms

Page 7: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

DefinitionDoob Martingale

Martingales

Definition

A sequence of random variables Z0,Z1, · · · is a martingale with respect to thesequence X0,X1, . . . if, for all n ≥ 0, the following conditions hold:

(i) Zn is a function of X0,X1, . . . ,Xn;

(ii) E[|Zn|] <∞(iii) E[Zn+1 | X0, . . . ,Xn] = Zn

A sequence of random variables Z0,Z1, · · · is called martingale, when it is a martingalewith respect to itself. That is, E[|Zn|] <∞, and E[Zn+1 | Z0, . . . ,Zn] = Zn.

Note

1 A Martingale can have a finite or a countably infinite number of elements.2 The indexing of the martingale sequence does not need to start at 0.

Nitesh Randomized Algorithms

Page 8: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

DefinitionDoob Martingale

Martingales

Definition

A sequence of random variables Z0,Z1, · · · is a martingale with respect to thesequence X0,X1, . . . if, for all n ≥ 0, the following conditions hold:

(i) Zn is a function of X0,X1, . . . ,Xn;

(ii) E[|Zn|] <∞(iii) E[Zn+1 | X0, . . . ,Xn] = Zn

A sequence of random variables Z0,Z1, · · · is called martingale, when it is a martingalewith respect to itself. That is, E[|Zn|] <∞, and E[Zn+1 | Z0, . . . ,Zn] = Zn.

Note

1 A Martingale can have a finite or a countably infinite number of elements.2 The indexing of the martingale sequence does not need to start at 0.

Nitesh Randomized Algorithms

Page 9: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

DefinitionDoob Martingale

Martingales

Definition

A sequence of random variables Z0,Z1, · · · is a martingale with respect to thesequence X0,X1, . . . if, for all n ≥ 0, the following conditions hold:

(i) Zn is a function of X0,X1, . . . ,Xn;

(ii) E[|Zn|] <∞

(iii) E[Zn+1 | X0, . . . ,Xn] = Zn

A sequence of random variables Z0,Z1, · · · is called martingale, when it is a martingalewith respect to itself. That is, E[|Zn|] <∞, and E[Zn+1 | Z0, . . . ,Zn] = Zn.

Note

1 A Martingale can have a finite or a countably infinite number of elements.2 The indexing of the martingale sequence does not need to start at 0.

Nitesh Randomized Algorithms

Page 10: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

DefinitionDoob Martingale

Martingales

Definition

A sequence of random variables Z0,Z1, · · · is a martingale with respect to thesequence X0,X1, . . . if, for all n ≥ 0, the following conditions hold:

(i) Zn is a function of X0,X1, . . . ,Xn;

(ii) E[|Zn|] <∞(iii) E[Zn+1 | X0, . . . ,Xn] = Zn

A sequence of random variables Z0,Z1, · · · is called martingale, when it is a martingalewith respect to itself. That is, E[|Zn|] <∞, and E[Zn+1 | Z0, . . . ,Zn] = Zn.

Note

1 A Martingale can have a finite or a countably infinite number of elements.2 The indexing of the martingale sequence does not need to start at 0.

Nitesh Randomized Algorithms

Page 11: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

DefinitionDoob Martingale

Martingales

Definition

A sequence of random variables Z0,Z1, · · · is a martingale with respect to thesequence X0,X1, . . . if, for all n ≥ 0, the following conditions hold:

(i) Zn is a function of X0,X1, . . . ,Xn;

(ii) E[|Zn|] <∞(iii) E[Zn+1 | X0, . . . ,Xn] = Zn

A sequence of random variables Z0,Z1, · · · is called martingale, when it is a martingalewith respect to itself. That is, E[|Zn|] <∞, and E[Zn+1 | Z0, . . . ,Zn] = Zn.

Note

1 A Martingale can have a finite or a countably infinite number of elements.2 The indexing of the martingale sequence does not need to start at 0.

Nitesh Randomized Algorithms

Page 12: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

DefinitionDoob Martingale

Martingales

Definition

A sequence of random variables Z0,Z1, · · · is a martingale with respect to thesequence X0,X1, . . . if, for all n ≥ 0, the following conditions hold:

(i) Zn is a function of X0,X1, . . . ,Xn;

(ii) E[|Zn|] <∞(iii) E[Zn+1 | X0, . . . ,Xn] = Zn

A sequence of random variables Z0,Z1, · · · is called martingale, when it is a martingalewith respect to itself. That is, E[|Zn|] <∞, and E[Zn+1 | Z0, . . . ,Zn] = Zn.

Note

1 A Martingale can have a finite or a countably infinite number of elements.2 The indexing of the martingale sequence does not need to start at 0.

Nitesh Randomized Algorithms

Page 13: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

DefinitionDoob Martingale

Martingales

Definition

A sequence of random variables Z0,Z1, · · · is a martingale with respect to thesequence X0,X1, . . . if, for all n ≥ 0, the following conditions hold:

(i) Zn is a function of X0,X1, . . . ,Xn;

(ii) E[|Zn|] <∞(iii) E[Zn+1 | X0, . . . ,Xn] = Zn

A sequence of random variables Z0,Z1, · · · is called martingale, when it is a martingalewith respect to itself. That is, E[|Zn|] <∞, and E[Zn+1 | Z0, . . . ,Zn] = Zn.

Note

1 A Martingale can have a finite or a countably infinite number of elements.

2 The indexing of the martingale sequence does not need to start at 0.

Nitesh Randomized Algorithms

Page 14: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

DefinitionDoob Martingale

Martingales

Definition

A sequence of random variables Z0,Z1, · · · is a martingale with respect to thesequence X0,X1, . . . if, for all n ≥ 0, the following conditions hold:

(i) Zn is a function of X0,X1, . . . ,Xn;

(ii) E[|Zn|] <∞(iii) E[Zn+1 | X0, . . . ,Xn] = Zn

A sequence of random variables Z0,Z1, · · · is called martingale, when it is a martingalewith respect to itself. That is, E[|Zn|] <∞, and E[Zn+1 | Z0, . . . ,Zn] = Zn.

Note

1 A Martingale can have a finite or a countably infinite number of elements.2 The indexing of the martingale sequence does not need to start at 0.

Nitesh Randomized Algorithms

Page 15: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

DefinitionDoob Martingale

Martingales

Example

Consider a gambler who plays a sequence of fair games. Let Xi be the amount thegambler wins on the i th game(Xi is negative if the gambler loses), and let Zi be thegambler’s total winnings at the end of the i th game.Because each game is fair,

1 E[Xi ] = 02 E[Zi+1 | X1,X2, . . . ,Xi ] = Zi + E[Xi+1] = Zi

Thus, Z1,Z2, . . . ,Zn is a martingale with respect to the sequence X1,X2, . . . ,Xn.

Note

The sequence is a martingale regardless of the amount bet on each game, even ifthese amounts are dependent upon previous results.

Nitesh Randomized Algorithms

Page 16: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

DefinitionDoob Martingale

Martingales

Example

Consider a gambler who plays a sequence of fair games. Let Xi be the amount thegambler wins on the i th game(Xi is negative if the gambler loses), and let Zi be thegambler’s total winnings at the end of the i th game.Because each game is fair,

1 E[Xi ] = 02 E[Zi+1 | X1,X2, . . . ,Xi ] = Zi + E[Xi+1] = Zi

Thus, Z1,Z2, . . . ,Zn is a martingale with respect to the sequence X1,X2, . . . ,Xn.

Note

The sequence is a martingale regardless of the amount bet on each game, even ifthese amounts are dependent upon previous results.

Nitesh Randomized Algorithms

Page 17: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

DefinitionDoob Martingale

Martingales

Example

Consider a gambler who plays a sequence of fair games.

Let Xi be the amount thegambler wins on the i th game(Xi is negative if the gambler loses), and let Zi be thegambler’s total winnings at the end of the i th game.Because each game is fair,

1 E[Xi ] = 02 E[Zi+1 | X1,X2, . . . ,Xi ] = Zi + E[Xi+1] = Zi

Thus, Z1,Z2, . . . ,Zn is a martingale with respect to the sequence X1,X2, . . . ,Xn.

Note

The sequence is a martingale regardless of the amount bet on each game, even ifthese amounts are dependent upon previous results.

Nitesh Randomized Algorithms

Page 18: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

DefinitionDoob Martingale

Martingales

Example

Consider a gambler who plays a sequence of fair games. Let Xi be the amount thegambler wins on the i th game(Xi is negative if the gambler loses), and let Zi be thegambler’s total winnings at the end of the i th game.

Because each game is fair,1 E[Xi ] = 02 E[Zi+1 | X1,X2, . . . ,Xi ] = Zi + E[Xi+1] = Zi

Thus, Z1,Z2, . . . ,Zn is a martingale with respect to the sequence X1,X2, . . . ,Xn.

Note

The sequence is a martingale regardless of the amount bet on each game, even ifthese amounts are dependent upon previous results.

Nitesh Randomized Algorithms

Page 19: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

DefinitionDoob Martingale

Martingales

Example

Consider a gambler who plays a sequence of fair games. Let Xi be the amount thegambler wins on the i th game(Xi is negative if the gambler loses), and let Zi be thegambler’s total winnings at the end of the i th game.Because each game is fair,

1 E[Xi ] = 02 E[Zi+1 | X1,X2, . . . ,Xi ] = Zi + E[Xi+1] = Zi

Thus, Z1,Z2, . . . ,Zn is a martingale with respect to the sequence X1,X2, . . . ,Xn.

Note

The sequence is a martingale regardless of the amount bet on each game, even ifthese amounts are dependent upon previous results.

Nitesh Randomized Algorithms

Page 20: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

DefinitionDoob Martingale

Martingales

Example

Consider a gambler who plays a sequence of fair games. Let Xi be the amount thegambler wins on the i th game(Xi is negative if the gambler loses), and let Zi be thegambler’s total winnings at the end of the i th game.Because each game is fair,

1 E[Xi ] = 0

2 E[Zi+1 | X1,X2, . . . ,Xi ] = Zi + E[Xi+1] = Zi

Thus, Z1,Z2, . . . ,Zn is a martingale with respect to the sequence X1,X2, . . . ,Xn.

Note

The sequence is a martingale regardless of the amount bet on each game, even ifthese amounts are dependent upon previous results.

Nitesh Randomized Algorithms

Page 21: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

DefinitionDoob Martingale

Martingales

Example

Consider a gambler who plays a sequence of fair games. Let Xi be the amount thegambler wins on the i th game(Xi is negative if the gambler loses), and let Zi be thegambler’s total winnings at the end of the i th game.Because each game is fair,

1 E[Xi ] = 02 E[Zi+1 | X1,X2, . . . ,Xi ] =

Zi + E[Xi+1] = Zi

Thus, Z1,Z2, . . . ,Zn is a martingale with respect to the sequence X1,X2, . . . ,Xn.

Note

The sequence is a martingale regardless of the amount bet on each game, even ifthese amounts are dependent upon previous results.

Nitesh Randomized Algorithms

Page 22: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

DefinitionDoob Martingale

Martingales

Example

Consider a gambler who plays a sequence of fair games. Let Xi be the amount thegambler wins on the i th game(Xi is negative if the gambler loses), and let Zi be thegambler’s total winnings at the end of the i th game.Because each game is fair,

1 E[Xi ] = 02 E[Zi+1 | X1,X2, . . . ,Xi ] = Zi + E[Xi+1] =

Zi

Thus, Z1,Z2, . . . ,Zn is a martingale with respect to the sequence X1,X2, . . . ,Xn.

Note

The sequence is a martingale regardless of the amount bet on each game, even ifthese amounts are dependent upon previous results.

Nitesh Randomized Algorithms

Page 23: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

DefinitionDoob Martingale

Martingales

Example

Consider a gambler who plays a sequence of fair games. Let Xi be the amount thegambler wins on the i th game(Xi is negative if the gambler loses), and let Zi be thegambler’s total winnings at the end of the i th game.Because each game is fair,

1 E[Xi ] = 02 E[Zi+1 | X1,X2, . . . ,Xi ] = Zi + E[Xi+1] = Zi

Thus, Z1,Z2, . . . ,Zn is a martingale with respect to the sequence X1,X2, . . . ,Xn.

Note

The sequence is a martingale regardless of the amount bet on each game, even ifthese amounts are dependent upon previous results.

Nitesh Randomized Algorithms

Page 24: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

DefinitionDoob Martingale

Martingales

Example

Consider a gambler who plays a sequence of fair games. Let Xi be the amount thegambler wins on the i th game(Xi is negative if the gambler loses), and let Zi be thegambler’s total winnings at the end of the i th game.Because each game is fair,

1 E[Xi ] = 02 E[Zi+1 | X1,X2, . . . ,Xi ] = Zi + E[Xi+1] = Zi

Thus, Z1,Z2, . . . ,Zn is a martingale with respect to the sequence X1,X2, . . . ,Xn.

Note

The sequence is a martingale regardless of the amount bet on each game, even ifthese amounts are dependent upon previous results.

Nitesh Randomized Algorithms

Page 25: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

DefinitionDoob Martingale

Martingales

Example

Consider a gambler who plays a sequence of fair games. Let Xi be the amount thegambler wins on the i th game(Xi is negative if the gambler loses), and let Zi be thegambler’s total winnings at the end of the i th game.Because each game is fair,

1 E[Xi ] = 02 E[Zi+1 | X1,X2, . . . ,Xi ] = Zi + E[Xi+1] = Zi

Thus, Z1,Z2, . . . ,Zn is a martingale with respect to the sequence X1,X2, . . . ,Xn.

Note

The sequence is a martingale regardless of the amount bet on each game, even ifthese amounts are dependent upon previous results.

Nitesh Randomized Algorithms

Page 26: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

DefinitionDoob Martingale

Martingales

Example

Consider a gambler who plays a sequence of fair games. Let Xi be the amount thegambler wins on the i th game(Xi is negative if the gambler loses), and let Zi be thegambler’s total winnings at the end of the i th game.Because each game is fair,

1 E[Xi ] = 02 E[Zi+1 | X1,X2, . . . ,Xi ] = Zi + E[Xi+1] = Zi

Thus, Z1,Z2, . . . ,Zn is a martingale with respect to the sequence X1,X2, . . . ,Xn.

Note

The sequence is a martingale regardless of the amount bet on each game, even ifthese amounts are dependent upon previous results.

Nitesh Randomized Algorithms

Page 27: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

DefinitionDoob Martingale

Outline

1 MartingalesDefinitionDoob Martingale

2 Stopping TimesIntroductionMartingale Stopping Theorem

3 Wald’s Equation

Nitesh Randomized Algorithms

Page 28: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

DefinitionDoob Martingale

Doob Martingale

Doob martingale

A Doob martingale refers to a martingale constructed using the following generalapproach.Let X0,X1, . . . ,Xn be a sequence of random variables, and let Y be a random variablewith E [|Y |] <∞. Then Zi = E[Y | X0, . . . ,Xi ], i = 0, 1, . . . , n, gives a martingalewith respect to X0,X1, . . . ,Xn, since

E[Zi+1 | X0, . . . ,Xi ] = E[E[Y | X0, . . . ,Xi ,Xi+1] | X0, . . . ,Xi ]

= E[Y | X0, . . . ,Xi ]

= Zi

Note

E[V | W ] = E[E[V | U,W ] | W ]

Nitesh Randomized Algorithms

Page 29: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

DefinitionDoob Martingale

Doob Martingale

Doob martingale

A Doob martingale refers to a martingale constructed using the following generalapproach.Let X0,X1, . . . ,Xn be a sequence of random variables, and let Y be a random variablewith E [|Y |] <∞. Then Zi = E[Y | X0, . . . ,Xi ], i = 0, 1, . . . , n, gives a martingalewith respect to X0,X1, . . . ,Xn, since

E[Zi+1 | X0, . . . ,Xi ] = E[E[Y | X0, . . . ,Xi ,Xi+1] | X0, . . . ,Xi ]

= E[Y | X0, . . . ,Xi ]

= Zi

Note

E[V | W ] = E[E[V | U,W ] | W ]

Nitesh Randomized Algorithms

Page 30: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

DefinitionDoob Martingale

Doob Martingale

Doob martingale

A Doob martingale refers to a martingale constructed using the following generalapproach.

Let X0,X1, . . . ,Xn be a sequence of random variables, and let Y be a random variablewith E [|Y |] <∞. Then Zi = E[Y | X0, . . . ,Xi ], i = 0, 1, . . . , n, gives a martingalewith respect to X0,X1, . . . ,Xn, since

E[Zi+1 | X0, . . . ,Xi ] = E[E[Y | X0, . . . ,Xi ,Xi+1] | X0, . . . ,Xi ]

= E[Y | X0, . . . ,Xi ]

= Zi

Note

E[V | W ] = E[E[V | U,W ] | W ]

Nitesh Randomized Algorithms

Page 31: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

DefinitionDoob Martingale

Doob Martingale

Doob martingale

A Doob martingale refers to a martingale constructed using the following generalapproach.Let X0,X1, . . . ,Xn be a sequence of random variables, and let Y be a random variablewith E [|Y |] <∞. Then

Zi = E[Y | X0, . . . ,Xi ], i = 0, 1, . . . , n, gives a martingalewith respect to X0,X1, . . . ,Xn, since

E[Zi+1 | X0, . . . ,Xi ] = E[E[Y | X0, . . . ,Xi ,Xi+1] | X0, . . . ,Xi ]

= E[Y | X0, . . . ,Xi ]

= Zi

Note

E[V | W ] = E[E[V | U,W ] | W ]

Nitesh Randomized Algorithms

Page 32: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

DefinitionDoob Martingale

Doob Martingale

Doob martingale

A Doob martingale refers to a martingale constructed using the following generalapproach.Let X0,X1, . . . ,Xn be a sequence of random variables, and let Y be a random variablewith E [|Y |] <∞. Then Zi = E[Y | X0, . . . ,Xi ], i = 0, 1, . . . , n, gives a martingalewith respect to X0,X1, . . . ,Xn, since

E[Zi+1 | X0, . . . ,Xi ] = E[E[Y | X0, . . . ,Xi ,Xi+1] | X0, . . . ,Xi ]

= E[Y | X0, . . . ,Xi ]

= Zi

Note

E[V | W ] = E[E[V | U,W ] | W ]

Nitesh Randomized Algorithms

Page 33: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

DefinitionDoob Martingale

Doob Martingale

Doob martingale

A Doob martingale refers to a martingale constructed using the following generalapproach.Let X0,X1, . . . ,Xn be a sequence of random variables, and let Y be a random variablewith E [|Y |] <∞. Then Zi = E[Y | X0, . . . ,Xi ], i = 0, 1, . . . , n, gives a martingalewith respect to X0,X1, . . . ,Xn, since

E[Zi+1 | X0, . . . ,Xi ] =

E[E[Y | X0, . . . ,Xi ,Xi+1] | X0, . . . ,Xi ]

= E[Y | X0, . . . ,Xi ]

= Zi

Note

E[V | W ] = E[E[V | U,W ] | W ]

Nitesh Randomized Algorithms

Page 34: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

DefinitionDoob Martingale

Doob Martingale

Doob martingale

A Doob martingale refers to a martingale constructed using the following generalapproach.Let X0,X1, . . . ,Xn be a sequence of random variables, and let Y be a random variablewith E [|Y |] <∞. Then Zi = E[Y | X0, . . . ,Xi ], i = 0, 1, . . . , n, gives a martingalewith respect to X0,X1, . . . ,Xn, since

E[Zi+1 | X0, . . . ,Xi ] = E[E[Y | X0, . . . ,Xi ,Xi+1] | X0, . . . ,Xi ]

= E[Y | X0, . . . ,Xi ]

= Zi

Note

E[V | W ] = E[E[V | U,W ] | W ]

Nitesh Randomized Algorithms

Page 35: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

DefinitionDoob Martingale

Doob Martingale

Doob martingale

A Doob martingale refers to a martingale constructed using the following generalapproach.Let X0,X1, . . . ,Xn be a sequence of random variables, and let Y be a random variablewith E [|Y |] <∞. Then Zi = E[Y | X0, . . . ,Xi ], i = 0, 1, . . . , n, gives a martingalewith respect to X0,X1, . . . ,Xn, since

E[Zi+1 | X0, . . . ,Xi ] = E[E[Y | X0, . . . ,Xi ,Xi+1] | X0, . . . ,Xi ]

= E[Y | X0, . . . ,Xi ]

= Zi

Note

E[V | W ] = E[E[V | U,W ] | W ]

Nitesh Randomized Algorithms

Page 36: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

DefinitionDoob Martingale

Doob Martingale

Doob martingale

A Doob martingale refers to a martingale constructed using the following generalapproach.Let X0,X1, . . . ,Xn be a sequence of random variables, and let Y be a random variablewith E [|Y |] <∞. Then Zi = E[Y | X0, . . . ,Xi ], i = 0, 1, . . . , n, gives a martingalewith respect to X0,X1, . . . ,Xn, since

E[Zi+1 | X0, . . . ,Xi ] = E[E[Y | X0, . . . ,Xi ,Xi+1] | X0, . . . ,Xi ]

= E[Y | X0, . . . ,Xi ]

= Zi

Note

E[V | W ] = E[E[V | U,W ] | W ]

Nitesh Randomized Algorithms

Page 37: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

DefinitionDoob Martingale

Doob Martingale

Doob martingale

A Doob martingale refers to a martingale constructed using the following generalapproach.Let X0,X1, . . . ,Xn be a sequence of random variables, and let Y be a random variablewith E [|Y |] <∞. Then Zi = E[Y | X0, . . . ,Xi ], i = 0, 1, . . . , n, gives a martingalewith respect to X0,X1, . . . ,Xn, since

E[Zi+1 | X0, . . . ,Xi ] = E[E[Y | X0, . . . ,Xi ,Xi+1] | X0, . . . ,Xi ]

= E[Y | X0, . . . ,Xi ]

= Zi

Note

E[V | W ] = E[E[V | U,W ] | W ]

Nitesh Randomized Algorithms

Page 38: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

DefinitionDoob Martingale

Doob martingale

Observations

In most applications we start Doob martingale with Z0 = E[Y ] which corresponds to X0being a trivial random variable that is independent of Y.Consider that we want to estimate the value of Y, whose value is a function of thevalues of the random variables X1, . . . ,Xn. The sequence Z0,Z1, . . . ,Zn represents asequence of refined estimates of the value of Y, gradually using more information onthe values of the random variables X1,X2, . . . ,Xn. Then

1 Z0 = E[Y ]

2 Zi = E[Y | X1, . . .Xi ]

3 Zn = Y , if Y is fully determined by X1, . . . ,Xn

Nitesh Randomized Algorithms

Page 39: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

DefinitionDoob Martingale

Doob martingale

Observations

In most applications we start Doob martingale with Z0 = E[Y ] which corresponds to X0being a trivial random variable that is independent of Y.Consider that we want to estimate the value of Y, whose value is a function of thevalues of the random variables X1, . . . ,Xn. The sequence Z0,Z1, . . . ,Zn represents asequence of refined estimates of the value of Y, gradually using more information onthe values of the random variables X1,X2, . . . ,Xn. Then

1 Z0 = E[Y ]

2 Zi = E[Y | X1, . . .Xi ]

3 Zn = Y , if Y is fully determined by X1, . . . ,Xn

Nitesh Randomized Algorithms

Page 40: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

DefinitionDoob Martingale

Doob martingale

Observations

In most applications we start Doob martingale with Z0 = E[Y ] which corresponds to X0being a trivial random variable that is independent of Y.

Consider that we want to estimate the value of Y, whose value is a function of thevalues of the random variables X1, . . . ,Xn. The sequence Z0,Z1, . . . ,Zn represents asequence of refined estimates of the value of Y, gradually using more information onthe values of the random variables X1,X2, . . . ,Xn. Then

1 Z0 = E[Y ]

2 Zi = E[Y | X1, . . .Xi ]

3 Zn = Y , if Y is fully determined by X1, . . . ,Xn

Nitesh Randomized Algorithms

Page 41: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

DefinitionDoob Martingale

Doob martingale

Observations

In most applications we start Doob martingale with Z0 = E[Y ] which corresponds to X0being a trivial random variable that is independent of Y.Consider that we want to estimate the value of Y,

whose value is a function of thevalues of the random variables X1, . . . ,Xn. The sequence Z0,Z1, . . . ,Zn represents asequence of refined estimates of the value of Y, gradually using more information onthe values of the random variables X1,X2, . . . ,Xn. Then

1 Z0 = E[Y ]

2 Zi = E[Y | X1, . . .Xi ]

3 Zn = Y , if Y is fully determined by X1, . . . ,Xn

Nitesh Randomized Algorithms

Page 42: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

DefinitionDoob Martingale

Doob martingale

Observations

In most applications we start Doob martingale with Z0 = E[Y ] which corresponds to X0being a trivial random variable that is independent of Y.Consider that we want to estimate the value of Y, whose value is a function of thevalues of the random variables X1, . . . ,Xn.

The sequence Z0,Z1, . . . ,Zn represents asequence of refined estimates of the value of Y, gradually using more information onthe values of the random variables X1,X2, . . . ,Xn. Then

1 Z0 = E[Y ]

2 Zi = E[Y | X1, . . .Xi ]

3 Zn = Y , if Y is fully determined by X1, . . . ,Xn

Nitesh Randomized Algorithms

Page 43: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

DefinitionDoob Martingale

Doob martingale

Observations

In most applications we start Doob martingale with Z0 = E[Y ] which corresponds to X0being a trivial random variable that is independent of Y.Consider that we want to estimate the value of Y, whose value is a function of thevalues of the random variables X1, . . . ,Xn. The sequence Z0,Z1, . . . ,Zn represents asequence of refined estimates of the value of Y, gradually using more information onthe values of the random variables X1,X2, . . . ,Xn. Then

1 Z0 = E[Y ]

2 Zi = E[Y | X1, . . .Xi ]

3 Zn = Y , if Y is fully determined by X1, . . . ,Xn

Nitesh Randomized Algorithms

Page 44: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

DefinitionDoob Martingale

Doob martingale

Observations

In most applications we start Doob martingale with Z0 = E[Y ] which corresponds to X0being a trivial random variable that is independent of Y.Consider that we want to estimate the value of Y, whose value is a function of thevalues of the random variables X1, . . . ,Xn. The sequence Z0,Z1, . . . ,Zn represents asequence of refined estimates of the value of Y, gradually using more information onthe values of the random variables X1,X2, . . . ,Xn. Then

1 Z0 = E[Y ]

2 Zi = E[Y | X1, . . .Xi ]

3 Zn = Y , if Y is fully determined by X1, . . . ,Xn

Nitesh Randomized Algorithms

Page 45: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

DefinitionDoob Martingale

Doob martingale

Observations

In most applications we start Doob martingale with Z0 = E[Y ] which corresponds to X0being a trivial random variable that is independent of Y.Consider that we want to estimate the value of Y, whose value is a function of thevalues of the random variables X1, . . . ,Xn. The sequence Z0,Z1, . . . ,Zn represents asequence of refined estimates of the value of Y, gradually using more information onthe values of the random variables X1,X2, . . . ,Xn. Then

1 Z0 = E[Y ]

2 Zi = E[Y | X1, . . .Xi ]

3 Zn = Y , if Y is fully determined by X1, . . . ,Xn

Nitesh Randomized Algorithms

Page 46: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

DefinitionDoob Martingale

Doob martingale

Observations

In most applications we start Doob martingale with Z0 = E[Y ] which corresponds to X0being a trivial random variable that is independent of Y.Consider that we want to estimate the value of Y, whose value is a function of thevalues of the random variables X1, . . . ,Xn. The sequence Z0,Z1, . . . ,Zn represents asequence of refined estimates of the value of Y, gradually using more information onthe values of the random variables X1,X2, . . . ,Xn. Then

1 Z0 = E[Y ]

2 Zi = E[Y | X1, . . .Xi ]

3 Zn = Y , if Y is fully determined by X1, . . . ,Xn

Nitesh Randomized Algorithms

Page 47: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

DefinitionDoob Martingale

Doob martingale - Examples

Edge exposure martingale

Let G be a random graph from Gn,p . We label all the m =

(n2

)possible edge slots in

some arbitrary order, and let

Xj =

{1, if there is an edge in the j th edge slot,0, otherwise.

Let F (G) be the size of the largest independent set in G.

1 Z0 = E[F (G)] and2 Zi = E[F (G) | X1, . . . ,Xi ]

The sequence Z0,Z1, . . . ,Zm is a Doob martingale that represents the conditionalexpectations of F (G) as we reveal whether each edge is in the graph, one edge at atime.This process of revealing edges gives a martingale called the edge exposuremartingale.

Nitesh Randomized Algorithms

Page 48: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

DefinitionDoob Martingale

Doob martingale - Examples

Edge exposure martingale

Let G be a random graph from Gn,p . We label all the m =

(n2

)possible edge slots in

some arbitrary order, and let

Xj =

{1, if there is an edge in the j th edge slot,0, otherwise.

Let F (G) be the size of the largest independent set in G.

1 Z0 = E[F (G)] and2 Zi = E[F (G) | X1, . . . ,Xi ]

The sequence Z0,Z1, . . . ,Zm is a Doob martingale that represents the conditionalexpectations of F (G) as we reveal whether each edge is in the graph, one edge at atime.This process of revealing edges gives a martingale called the edge exposuremartingale.

Nitesh Randomized Algorithms

Page 49: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

DefinitionDoob Martingale

Doob martingale - Examples

Edge exposure martingale

Let G be a random graph from Gn,p .

We label all the m =

(n2

)possible edge slots in

some arbitrary order, and let

Xj =

{1, if there is an edge in the j th edge slot,0, otherwise.

Let F (G) be the size of the largest independent set in G.

1 Z0 = E[F (G)] and2 Zi = E[F (G) | X1, . . . ,Xi ]

The sequence Z0,Z1, . . . ,Zm is a Doob martingale that represents the conditionalexpectations of F (G) as we reveal whether each edge is in the graph, one edge at atime.This process of revealing edges gives a martingale called the edge exposuremartingale.

Nitesh Randomized Algorithms

Page 50: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

DefinitionDoob Martingale

Doob martingale - Examples

Edge exposure martingale

Let G be a random graph from Gn,p . We label all the m =

(n2

)possible edge slots in

some arbitrary order, and let

Xj =

{1, if there is an edge in the j th edge slot,0, otherwise.

Let F (G) be the size of the largest independent set in G.

1 Z0 = E[F (G)] and2 Zi = E[F (G) | X1, . . . ,Xi ]

The sequence Z0,Z1, . . . ,Zm is a Doob martingale that represents the conditionalexpectations of F (G) as we reveal whether each edge is in the graph, one edge at atime.This process of revealing edges gives a martingale called the edge exposuremartingale.

Nitesh Randomized Algorithms

Page 51: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

DefinitionDoob Martingale

Doob martingale - Examples

Edge exposure martingale

Let G be a random graph from Gn,p . We label all the m =

(n2

)possible edge slots in

some arbitrary order, and let

Xj =

{1, if there is an edge in the j th edge slot,0, otherwise.

Let F (G) be the size of the largest independent set in G.

1 Z0 = E[F (G)] and2 Zi = E[F (G) | X1, . . . ,Xi ]

The sequence Z0,Z1, . . . ,Zm is a Doob martingale that represents the conditionalexpectations of F (G) as we reveal whether each edge is in the graph, one edge at atime.This process of revealing edges gives a martingale called the edge exposuremartingale.

Nitesh Randomized Algorithms

Page 52: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

DefinitionDoob Martingale

Doob martingale - Examples

Edge exposure martingale

Let G be a random graph from Gn,p . We label all the m =

(n2

)possible edge slots in

some arbitrary order, and let

Xj =

{1, if there is an edge in the j th edge slot,0, otherwise.

Let F (G) be the size of the largest independent set in G.

1 Z0 = E[F (G)] and2 Zi = E[F (G) | X1, . . . ,Xi ]

The sequence Z0,Z1, . . . ,Zm is a Doob martingale that represents the conditionalexpectations of F (G) as we reveal whether each edge is in the graph, one edge at atime.This process of revealing edges gives a martingale called the edge exposuremartingale.

Nitesh Randomized Algorithms

Page 53: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

DefinitionDoob Martingale

Doob martingale - Examples

Edge exposure martingale

Let G be a random graph from Gn,p . We label all the m =

(n2

)possible edge slots in

some arbitrary order, and let

Xj =

{1, if there is an edge in the j th edge slot,0, otherwise.

Let F (G) be the size of the largest independent set in G.

1 Z0 = E[F (G)] and

2 Zi = E[F (G) | X1, . . . ,Xi ]

The sequence Z0,Z1, . . . ,Zm is a Doob martingale that represents the conditionalexpectations of F (G) as we reveal whether each edge is in the graph, one edge at atime.This process of revealing edges gives a martingale called the edge exposuremartingale.

Nitesh Randomized Algorithms

Page 54: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

DefinitionDoob Martingale

Doob martingale - Examples

Edge exposure martingale

Let G be a random graph from Gn,p . We label all the m =

(n2

)possible edge slots in

some arbitrary order, and let

Xj =

{1, if there is an edge in the j th edge slot,0, otherwise.

Let F (G) be the size of the largest independent set in G.

1 Z0 = E[F (G)] and2 Zi = E[F (G) | X1, . . . ,Xi ]

The sequence Z0,Z1, . . . ,Zm is a Doob martingale that represents the conditionalexpectations of F (G) as we reveal whether each edge is in the graph, one edge at atime.This process of revealing edges gives a martingale called the edge exposuremartingale.

Nitesh Randomized Algorithms

Page 55: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

DefinitionDoob Martingale

Doob martingale - Examples

Edge exposure martingale

Let G be a random graph from Gn,p . We label all the m =

(n2

)possible edge slots in

some arbitrary order, and let

Xj =

{1, if there is an edge in the j th edge slot,0, otherwise.

Let F (G) be the size of the largest independent set in G.

1 Z0 = E[F (G)] and2 Zi = E[F (G) | X1, . . . ,Xi ]

The sequence Z0,Z1, . . . ,Zm is a Doob martingale that represents the conditionalexpectations of F (G) as we reveal whether each edge is in the graph, one edge at atime.

This process of revealing edges gives a martingale called the edge exposuremartingale.

Nitesh Randomized Algorithms

Page 56: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

DefinitionDoob Martingale

Doob martingale - Examples

Edge exposure martingale

Let G be a random graph from Gn,p . We label all the m =

(n2

)possible edge slots in

some arbitrary order, and let

Xj =

{1, if there is an edge in the j th edge slot,0, otherwise.

Let F (G) be the size of the largest independent set in G.

1 Z0 = E[F (G)] and2 Zi = E[F (G) | X1, . . . ,Xi ]

The sequence Z0,Z1, . . . ,Zm is a Doob martingale that represents the conditionalexpectations of F (G) as we reveal whether each edge is in the graph, one edge at atime.This process of revealing edges gives a martingale called the edge exposuremartingale.

Nitesh Randomized Algorithms

Page 57: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

DefinitionDoob Martingale

Doob martingale - Examples

Vertex exposure martingale

Instead of revealing edges one at a time, we could reveal the set of edges connected toa vertex, one vertex at a time.Consider the arbitrary numbering of vertices 1 through n, and let Gi be the subgraph ofG induced by the first i vertices. Then, setting

1 Z0 = E[F (G)] and2 Zi = E[F (G) | G1, . . . ,Gi ] i = 1, ....., n,

gives a Doob martingale that is commonly called the vertex exposure martingale.

Nitesh Randomized Algorithms

Page 58: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

DefinitionDoob Martingale

Doob martingale - Examples

Vertex exposure martingale

Instead of revealing edges one at a time, we could reveal the set of edges connected toa vertex, one vertex at a time.

Consider the arbitrary numbering of vertices 1 through n, and let Gi be the subgraph ofG induced by the first i vertices. Then, setting

1 Z0 = E[F (G)] and2 Zi = E[F (G) | G1, . . . ,Gi ] i = 1, ....., n,

gives a Doob martingale that is commonly called the vertex exposure martingale.

Nitesh Randomized Algorithms

Page 59: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

DefinitionDoob Martingale

Doob martingale - Examples

Vertex exposure martingale

Instead of revealing edges one at a time, we could reveal the set of edges connected toa vertex, one vertex at a time.Consider the arbitrary numbering of vertices 1 through n,

and let Gi be the subgraph ofG induced by the first i vertices. Then, setting

1 Z0 = E[F (G)] and2 Zi = E[F (G) | G1, . . . ,Gi ] i = 1, ....., n,

gives a Doob martingale that is commonly called the vertex exposure martingale.

Nitesh Randomized Algorithms

Page 60: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

DefinitionDoob Martingale

Doob martingale - Examples

Vertex exposure martingale

Instead of revealing edges one at a time, we could reveal the set of edges connected toa vertex, one vertex at a time.Consider the arbitrary numbering of vertices 1 through n, and let Gi be the subgraph ofG induced by the first i vertices. Then, setting

1 Z0 = E[F (G)] and2 Zi = E[F (G) | G1, . . . ,Gi ] i = 1, ....., n,

gives a Doob martingale that is commonly called the vertex exposure martingale.

Nitesh Randomized Algorithms

Page 61: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

DefinitionDoob Martingale

Doob martingale - Examples

Vertex exposure martingale

Instead of revealing edges one at a time, we could reveal the set of edges connected toa vertex, one vertex at a time.Consider the arbitrary numbering of vertices 1 through n, and let Gi be the subgraph ofG induced by the first i vertices. Then, setting

1 Z0 = E[F (G)] and

2 Zi = E[F (G) | G1, . . . ,Gi ] i = 1, ....., n,

gives a Doob martingale that is commonly called the vertex exposure martingale.

Nitesh Randomized Algorithms

Page 62: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

DefinitionDoob Martingale

Doob martingale - Examples

Vertex exposure martingale

Instead of revealing edges one at a time, we could reveal the set of edges connected toa vertex, one vertex at a time.Consider the arbitrary numbering of vertices 1 through n, and let Gi be the subgraph ofG induced by the first i vertices. Then, setting

1 Z0 = E[F (G)] and2 Zi = E[F (G) | G1, . . . ,Gi ] i = 1, ....., n,

gives a Doob martingale that is commonly called the vertex exposure martingale.

Nitesh Randomized Algorithms

Page 63: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

DefinitionDoob Martingale

Doob martingale - Examples

Vertex exposure martingale

Instead of revealing edges one at a time, we could reveal the set of edges connected toa vertex, one vertex at a time.Consider the arbitrary numbering of vertices 1 through n, and let Gi be the subgraph ofG induced by the first i vertices. Then, setting

1 Z0 = E[F (G)] and2 Zi = E[F (G) | G1, . . . ,Gi ] i = 1, ....., n,

gives a Doob martingale that is commonly called the vertex exposure martingale.

Nitesh Randomized Algorithms

Page 64: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

IntroductionMartingale Stopping Theorem

Outline

1 MartingalesDefinitionDoob Martingale

2 Stopping TimesIntroductionMartingale Stopping Theorem

3 Wald’s Equation

Nitesh Randomized Algorithms

Page 65: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

IntroductionMartingale Stopping Theorem

Stopping Times

Stopping Times

Consider again the Gambler who participates in a sequence of fair gambling rounds,and Zi is the gamblers winnings after the i th game. If the player decides (before startingto play) to quit after exactly k games, what are the gambler’s expected winnings?

Lemma

If the sequence Z0,Z1, . . . ,Zn is a martingale with respect to X0,X1, . . . ,Xn, thenE[Zn] = E[Z0]

Nitesh Randomized Algorithms

Page 66: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

IntroductionMartingale Stopping Theorem

Stopping Times

Stopping Times

Consider again the Gambler who participates in a sequence of fair gambling rounds,and Zi is the gamblers winnings after the i th game. If the player decides (before startingto play) to quit after exactly k games, what are the gambler’s expected winnings?

Lemma

If the sequence Z0,Z1, . . . ,Zn is a martingale with respect to X0,X1, . . . ,Xn, thenE[Zn] = E[Z0]

Nitesh Randomized Algorithms

Page 67: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

IntroductionMartingale Stopping Theorem

Stopping Times

Stopping Times

Consider again the Gambler who participates in a sequence of fair gambling rounds,

and Zi is the gamblers winnings after the i th game. If the player decides (before startingto play) to quit after exactly k games, what are the gambler’s expected winnings?

Lemma

If the sequence Z0,Z1, . . . ,Zn is a martingale with respect to X0,X1, . . . ,Xn, thenE[Zn] = E[Z0]

Nitesh Randomized Algorithms

Page 68: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

IntroductionMartingale Stopping Theorem

Stopping Times

Stopping Times

Consider again the Gambler who participates in a sequence of fair gambling rounds,and Zi is the gamblers winnings after the i th game.

If the player decides (before startingto play) to quit after exactly k games, what are the gambler’s expected winnings?

Lemma

If the sequence Z0,Z1, . . . ,Zn is a martingale with respect to X0,X1, . . . ,Xn, thenE[Zn] = E[Z0]

Nitesh Randomized Algorithms

Page 69: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

IntroductionMartingale Stopping Theorem

Stopping Times

Stopping Times

Consider again the Gambler who participates in a sequence of fair gambling rounds,and Zi is the gamblers winnings after the i th game. If the player decides (before startingto play) to quit after exactly k games, what are the gambler’s expected winnings?

Lemma

If the sequence Z0,Z1, . . . ,Zn is a martingale with respect to X0,X1, . . . ,Xn, thenE[Zn] = E[Z0]

Nitesh Randomized Algorithms

Page 70: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

IntroductionMartingale Stopping Theorem

Stopping Times

Stopping Times

Consider again the Gambler who participates in a sequence of fair gambling rounds,and Zi is the gamblers winnings after the i th game. If the player decides (before startingto play) to quit after exactly k games, what are the gambler’s expected winnings?

Lemma

If the sequence Z0,Z1, . . . ,Zn is a martingale with respect to X0,X1, . . . ,Xn, thenE[Zn] = E[Z0]

Nitesh Randomized Algorithms

Page 71: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

IntroductionMartingale Stopping Theorem

Stopping Times

Stopping Times

Consider again the Gambler who participates in a sequence of fair gambling rounds,and Zi is the gamblers winnings after the i th game. If the player decides (before startingto play) to quit after exactly k games, what are the gambler’s expected winnings?

Lemma

If the sequence Z0,Z1, . . . ,Zn is a martingale with respect to X0,X1, . . . ,Xn, thenE[Zn] =

E[Z0]

Nitesh Randomized Algorithms

Page 72: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

IntroductionMartingale Stopping Theorem

Stopping Times

Stopping Times

Consider again the Gambler who participates in a sequence of fair gambling rounds,and Zi is the gamblers winnings after the i th game. If the player decides (before startingto play) to quit after exactly k games, what are the gambler’s expected winnings?

Lemma

If the sequence Z0,Z1, . . . ,Zn is a martingale with respect to X0,X1, . . . ,Xn, thenE[Zn] = E[Z0]

Nitesh Randomized Algorithms

Page 73: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

IntroductionMartingale Stopping Theorem

Stopping Times

Proof

Since Z0,Z1, . . . ,Zn is a martingale with respect to X0,X1, . . . ,Xn, it follows that

Zi = E[Zi+1 | X0,X1, . . . ,Xi ].

Taking the expectation on both sides and using the definition of conditional expectation,we have

E[Zi ] = E[E[Zi+1 | X0,X1, . . . ,Xi ]].= E[Zi+1]

Repeating this argument yieldsE[Zn] = E[Z0]

Thus, if the number of games played is initially fixed then the expected gain from thesequence of games is zero.

Note

The gambler could decide to keep playing until his winnings total at least a hundreddollars. The following notion proves quite powerful.

Nitesh Randomized Algorithms

Page 74: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

IntroductionMartingale Stopping Theorem

Stopping Times

Proof

Since Z0,Z1, . . . ,Zn is a martingale with respect to X0,X1, . . . ,Xn, it follows that

Zi = E[Zi+1 | X0,X1, . . . ,Xi ].

Taking the expectation on both sides and using the definition of conditional expectation,we have

E[Zi ] = E[E[Zi+1 | X0,X1, . . . ,Xi ]].= E[Zi+1]

Repeating this argument yieldsE[Zn] = E[Z0]

Thus, if the number of games played is initially fixed then the expected gain from thesequence of games is zero.

Note

The gambler could decide to keep playing until his winnings total at least a hundreddollars. The following notion proves quite powerful.

Nitesh Randomized Algorithms

Page 75: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

IntroductionMartingale Stopping Theorem

Stopping Times

Proof

Since Z0,Z1, . . . ,Zn is a martingale with respect to X0,X1, . . . ,Xn, it follows that

Zi = E[Zi+1 | X0,X1, . . . ,Xi ].

Taking the expectation on both sides and using the definition of conditional expectation,we have

E[Zi ] = E[E[Zi+1 | X0,X1, . . . ,Xi ]].= E[Zi+1]

Repeating this argument yieldsE[Zn] = E[Z0]

Thus, if the number of games played is initially fixed then the expected gain from thesequence of games is zero.

Note

The gambler could decide to keep playing until his winnings total at least a hundreddollars. The following notion proves quite powerful.

Nitesh Randomized Algorithms

Page 76: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

IntroductionMartingale Stopping Theorem

Stopping Times

Proof

Since Z0,Z1, . . . ,Zn is a martingale with respect to X0,X1, . . . ,Xn, it follows that

Zi = E[Zi+1 | X0,X1, . . . ,Xi ].

Taking the expectation on both sides and using the definition of conditional expectation,we have

E[Zi ] = E[E[Zi+1 | X0,X1, . . . ,Xi ]].= E[Zi+1]

Repeating this argument yieldsE[Zn] = E[Z0]

Thus, if the number of games played is initially fixed then the expected gain from thesequence of games is zero.

Note

The gambler could decide to keep playing until his winnings total at least a hundreddollars. The following notion proves quite powerful.

Nitesh Randomized Algorithms

Page 77: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

IntroductionMartingale Stopping Theorem

Stopping Times

Proof

Since Z0,Z1, . . . ,Zn is a martingale with respect to X0,X1, . . . ,Xn, it follows that

Zi = E[Zi+1 | X0,X1, . . . ,Xi ].

Taking the expectation on both sides and using the definition of conditional expectation,we have

E[Zi ] = E[E[Zi+1 | X0,X1, . . . ,Xi ]].= E[Zi+1]

Repeating this argument yieldsE[Zn] = E[Z0]

Thus, if the number of games played is initially fixed then the expected gain from thesequence of games is zero.

Note

The gambler could decide to keep playing until his winnings total at least a hundreddollars. The following notion proves quite powerful.

Nitesh Randomized Algorithms

Page 78: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

IntroductionMartingale Stopping Theorem

Stopping Times

Proof

Since Z0,Z1, . . . ,Zn is a martingale with respect to X0,X1, . . . ,Xn, it follows that

Zi = E[Zi+1 | X0,X1, . . . ,Xi ].

Taking the expectation on both sides and using the definition of conditional expectation,we have

E[Zi ] = E[E[Zi+1 | X0,X1, . . . ,Xi ]].

= E[Zi+1]

Repeating this argument yieldsE[Zn] = E[Z0]

Thus, if the number of games played is initially fixed then the expected gain from thesequence of games is zero.

Note

The gambler could decide to keep playing until his winnings total at least a hundreddollars. The following notion proves quite powerful.

Nitesh Randomized Algorithms

Page 79: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

IntroductionMartingale Stopping Theorem

Stopping Times

Proof

Since Z0,Z1, . . . ,Zn is a martingale with respect to X0,X1, . . . ,Xn, it follows that

Zi = E[Zi+1 | X0,X1, . . . ,Xi ].

Taking the expectation on both sides and using the definition of conditional expectation,we have

E[Zi ] = E[E[Zi+1 | X0,X1, . . . ,Xi ]].= E[Zi+1]

Repeating this argument yieldsE[Zn] = E[Z0]

Thus, if the number of games played is initially fixed then the expected gain from thesequence of games is zero.

Note

The gambler could decide to keep playing until his winnings total at least a hundreddollars. The following notion proves quite powerful.

Nitesh Randomized Algorithms

Page 80: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

IntroductionMartingale Stopping Theorem

Stopping Times

Proof

Since Z0,Z1, . . . ,Zn is a martingale with respect to X0,X1, . . . ,Xn, it follows that

Zi = E[Zi+1 | X0,X1, . . . ,Xi ].

Taking the expectation on both sides and using the definition of conditional expectation,we have

E[Zi ] = E[E[Zi+1 | X0,X1, . . . ,Xi ]].= E[Zi+1]

Repeating this argument yieldsE[Zn] = E[Z0]

Thus, if the number of games played is initially fixed then the expected gain from thesequence of games is zero.

Note

The gambler could decide to keep playing until his winnings total at least a hundreddollars. The following notion proves quite powerful.

Nitesh Randomized Algorithms

Page 81: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

IntroductionMartingale Stopping Theorem

Stopping Times

Proof

Since Z0,Z1, . . . ,Zn is a martingale with respect to X0,X1, . . . ,Xn, it follows that

Zi = E[Zi+1 | X0,X1, . . . ,Xi ].

Taking the expectation on both sides and using the definition of conditional expectation,we have

E[Zi ] = E[E[Zi+1 | X0,X1, . . . ,Xi ]].= E[Zi+1]

Repeating this argument yieldsE[Zn] = E[Z0]

Thus, if the number of games played is initially fixed then the expected gain from thesequence of games is zero.

Note

The gambler could decide to keep playing until his winnings total at least a hundreddollars. The following notion proves quite powerful.

Nitesh Randomized Algorithms

Page 82: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

IntroductionMartingale Stopping Theorem

Stopping Times

Proof

Since Z0,Z1, . . . ,Zn is a martingale with respect to X0,X1, . . . ,Xn, it follows that

Zi = E[Zi+1 | X0,X1, . . . ,Xi ].

Taking the expectation on both sides and using the definition of conditional expectation,we have

E[Zi ] = E[E[Zi+1 | X0,X1, . . . ,Xi ]].= E[Zi+1]

Repeating this argument yieldsE[Zn] = E[Z0]

Thus, if the number of games played is initially fixed then the expected gain from thesequence of games is zero.

Note

The gambler could decide to keep playing until his winnings total at least a hundreddollars. The following notion proves quite powerful.

Nitesh Randomized Algorithms

Page 83: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

IntroductionMartingale Stopping Theorem

Stopping Times

Proof

Since Z0,Z1, . . . ,Zn is a martingale with respect to X0,X1, . . . ,Xn, it follows that

Zi = E[Zi+1 | X0,X1, . . . ,Xi ].

Taking the expectation on both sides and using the definition of conditional expectation,we have

E[Zi ] = E[E[Zi+1 | X0,X1, . . . ,Xi ]].= E[Zi+1]

Repeating this argument yieldsE[Zn] = E[Z0]

Thus, if the number of games played is initially fixed then the expected gain from thesequence of games is zero.

Note

The gambler could decide to keep playing until his winnings total at least a hundreddollars. The following notion proves quite powerful.

Nitesh Randomized Algorithms

Page 84: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

IntroductionMartingale Stopping Theorem

Stopping Times

Definition

A nonnegative, integer-valued random variable T is a stopping time for the sequence{Zn, n ≥ 0} if the event T = n depends only on the value of the random variablesZ0,Z1, . . . ,Zn.

Which of the following are stopping times?

1 First time the gambler wins five games in a row - Stopping Time2 First time the gambler has won at least a hundred dollars - Stopping Time3 Last time the gambler wins five games in a row - Not a stopping time (needs

knowledge of Zn+1,Zn+2, . . .)

Note

The subtle problem with the stopping times like, the first T such that ZT > B where B isa fixed constant greater than 0, is that it may not be finite, so the gambler may neverfinish playing.

Nitesh Randomized Algorithms

Page 85: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

IntroductionMartingale Stopping Theorem

Stopping Times

Definition

A nonnegative, integer-valued random variable T is a stopping time for the sequence{Zn, n ≥ 0} if the event T = n depends only on the value of the random variablesZ0,Z1, . . . ,Zn.

Which of the following are stopping times?

1 First time the gambler wins five games in a row - Stopping Time2 First time the gambler has won at least a hundred dollars - Stopping Time3 Last time the gambler wins five games in a row - Not a stopping time (needs

knowledge of Zn+1,Zn+2, . . .)

Note

The subtle problem with the stopping times like, the first T such that ZT > B where B isa fixed constant greater than 0, is that it may not be finite, so the gambler may neverfinish playing.

Nitesh Randomized Algorithms

Page 86: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

IntroductionMartingale Stopping Theorem

Stopping Times

Definition

A nonnegative, integer-valued random variable T is a stopping time for the sequence{Zn, n ≥ 0} if the event T = n depends only on the value of the random variablesZ0,Z1, . . . ,Zn.

Which of the following are stopping times?

1 First time the gambler wins five games in a row - Stopping Time2 First time the gambler has won at least a hundred dollars - Stopping Time3 Last time the gambler wins five games in a row - Not a stopping time (needs

knowledge of Zn+1,Zn+2, . . .)

Note

The subtle problem with the stopping times like, the first T such that ZT > B where B isa fixed constant greater than 0, is that it may not be finite, so the gambler may neverfinish playing.

Nitesh Randomized Algorithms

Page 87: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

IntroductionMartingale Stopping Theorem

Stopping Times

Definition

A nonnegative, integer-valued random variable T is a stopping time for the sequence{Zn, n ≥ 0} if the event T = n depends only on the value of the random variablesZ0,Z1, . . . ,Zn.

Which of the following are stopping times?

1 First time the gambler wins five games in a row - Stopping Time2 First time the gambler has won at least a hundred dollars - Stopping Time3 Last time the gambler wins five games in a row - Not a stopping time (needs

knowledge of Zn+1,Zn+2, . . .)

Note

The subtle problem with the stopping times like, the first T such that ZT > B where B isa fixed constant greater than 0, is that it may not be finite, so the gambler may neverfinish playing.

Nitesh Randomized Algorithms

Page 88: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

IntroductionMartingale Stopping Theorem

Stopping Times

Definition

A nonnegative, integer-valued random variable T is a stopping time for the sequence{Zn, n ≥ 0} if the event T = n depends only on the value of the random variablesZ0,Z1, . . . ,Zn.

Which of the following are stopping times?

1 First time the gambler wins five games in a row -

Stopping Time2 First time the gambler has won at least a hundred dollars - Stopping Time3 Last time the gambler wins five games in a row - Not a stopping time (needs

knowledge of Zn+1,Zn+2, . . .)

Note

The subtle problem with the stopping times like, the first T such that ZT > B where B isa fixed constant greater than 0, is that it may not be finite, so the gambler may neverfinish playing.

Nitesh Randomized Algorithms

Page 89: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

IntroductionMartingale Stopping Theorem

Stopping Times

Definition

A nonnegative, integer-valued random variable T is a stopping time for the sequence{Zn, n ≥ 0} if the event T = n depends only on the value of the random variablesZ0,Z1, . . . ,Zn.

Which of the following are stopping times?

1 First time the gambler wins five games in a row - Stopping Time

2 First time the gambler has won at least a hundred dollars - Stopping Time3 Last time the gambler wins five games in a row - Not a stopping time (needs

knowledge of Zn+1,Zn+2, . . .)

Note

The subtle problem with the stopping times like, the first T such that ZT > B where B isa fixed constant greater than 0, is that it may not be finite, so the gambler may neverfinish playing.

Nitesh Randomized Algorithms

Page 90: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

IntroductionMartingale Stopping Theorem

Stopping Times

Definition

A nonnegative, integer-valued random variable T is a stopping time for the sequence{Zn, n ≥ 0} if the event T = n depends only on the value of the random variablesZ0,Z1, . . . ,Zn.

Which of the following are stopping times?

1 First time the gambler wins five games in a row - Stopping Time2 First time the gambler has won at least a hundred dollars -

Stopping Time3 Last time the gambler wins five games in a row - Not a stopping time (needs

knowledge of Zn+1,Zn+2, . . .)

Note

The subtle problem with the stopping times like, the first T such that ZT > B where B isa fixed constant greater than 0, is that it may not be finite, so the gambler may neverfinish playing.

Nitesh Randomized Algorithms

Page 91: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

IntroductionMartingale Stopping Theorem

Stopping Times

Definition

A nonnegative, integer-valued random variable T is a stopping time for the sequence{Zn, n ≥ 0} if the event T = n depends only on the value of the random variablesZ0,Z1, . . . ,Zn.

Which of the following are stopping times?

1 First time the gambler wins five games in a row - Stopping Time2 First time the gambler has won at least a hundred dollars - Stopping Time

3 Last time the gambler wins five games in a row - Not a stopping time (needsknowledge of Zn+1,Zn+2, . . .)

Note

The subtle problem with the stopping times like, the first T such that ZT > B where B isa fixed constant greater than 0, is that it may not be finite, so the gambler may neverfinish playing.

Nitesh Randomized Algorithms

Page 92: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

IntroductionMartingale Stopping Theorem

Stopping Times

Definition

A nonnegative, integer-valued random variable T is a stopping time for the sequence{Zn, n ≥ 0} if the event T = n depends only on the value of the random variablesZ0,Z1, . . . ,Zn.

Which of the following are stopping times?

1 First time the gambler wins five games in a row - Stopping Time2 First time the gambler has won at least a hundred dollars - Stopping Time3 Last time the gambler wins five games in a row -

Not a stopping time (needsknowledge of Zn+1,Zn+2, . . .)

Note

The subtle problem with the stopping times like, the first T such that ZT > B where B isa fixed constant greater than 0, is that it may not be finite, so the gambler may neverfinish playing.

Nitesh Randomized Algorithms

Page 93: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

IntroductionMartingale Stopping Theorem

Stopping Times

Definition

A nonnegative, integer-valued random variable T is a stopping time for the sequence{Zn, n ≥ 0} if the event T = n depends only on the value of the random variablesZ0,Z1, . . . ,Zn.

Which of the following are stopping times?

1 First time the gambler wins five games in a row - Stopping Time2 First time the gambler has won at least a hundred dollars - Stopping Time3 Last time the gambler wins five games in a row - Not a stopping time

(needsknowledge of Zn+1,Zn+2, . . .)

Note

The subtle problem with the stopping times like, the first T such that ZT > B where B isa fixed constant greater than 0, is that it may not be finite, so the gambler may neverfinish playing.

Nitesh Randomized Algorithms

Page 94: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

IntroductionMartingale Stopping Theorem

Stopping Times

Definition

A nonnegative, integer-valued random variable T is a stopping time for the sequence{Zn, n ≥ 0} if the event T = n depends only on the value of the random variablesZ0,Z1, . . . ,Zn.

Which of the following are stopping times?

1 First time the gambler wins five games in a row - Stopping Time2 First time the gambler has won at least a hundred dollars - Stopping Time3 Last time the gambler wins five games in a row - Not a stopping time (needs

knowledge of Zn+1,Zn+2, . . .)

Note

The subtle problem with the stopping times like, the first T such that ZT > B where B isa fixed constant greater than 0, is that it may not be finite, so the gambler may neverfinish playing.

Nitesh Randomized Algorithms

Page 95: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

IntroductionMartingale Stopping Theorem

Stopping Times

Definition

A nonnegative, integer-valued random variable T is a stopping time for the sequence{Zn, n ≥ 0} if the event T = n depends only on the value of the random variablesZ0,Z1, . . . ,Zn.

Which of the following are stopping times?

1 First time the gambler wins five games in a row - Stopping Time2 First time the gambler has won at least a hundred dollars - Stopping Time3 Last time the gambler wins five games in a row - Not a stopping time (needs

knowledge of Zn+1,Zn+2, . . .)

Note

The subtle problem with the stopping times like, the first T such that ZT > B where B isa fixed constant greater than 0, is that it may not be finite, so the gambler may neverfinish playing.

Nitesh Randomized Algorithms

Page 96: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

IntroductionMartingale Stopping Theorem

Stopping Times

Definition

A nonnegative, integer-valued random variable T is a stopping time for the sequence{Zn, n ≥ 0} if the event T = n depends only on the value of the random variablesZ0,Z1, . . . ,Zn.

Which of the following are stopping times?

1 First time the gambler wins five games in a row - Stopping Time2 First time the gambler has won at least a hundred dollars - Stopping Time3 Last time the gambler wins five games in a row - Not a stopping time (needs

knowledge of Zn+1,Zn+2, . . .)

Note

The subtle problem with the stopping times like, the first T such that ZT > B where B isa fixed constant greater than 0, is that it may not be finite, so the gambler may neverfinish playing.

Nitesh Randomized Algorithms

Page 97: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

IntroductionMartingale Stopping Theorem

Outline

1 MartingalesDefinitionDoob Martingale

2 Stopping TimesIntroductionMartingale Stopping Theorem

3 Wald’s Equation

Nitesh Randomized Algorithms

Page 98: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

IntroductionMartingale Stopping Theorem

Martingale Stopping Theorem

Theorem

If Z0,Z1, . . . is a martingale with respect to X1,X2, . . . and if T is a stopping time forX1,X2, . . ., then

E[ZT ] = E[Z0]

whenever one of the following holds:1 The Zi are bounded, so there is a constant c such that, for all i, |Zi | ≤ c;2 T is bounded;3 E[T ] <∞, and there is a constant c such that E[|Zi+1 − Zi | | X1, . . . ,Xi ] < c.

Nitesh Randomized Algorithms

Page 99: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

IntroductionMartingale Stopping Theorem

Martingale Stopping Theorem

Theorem

If Z0,Z1, . . . is a martingale with respect to X1,X2, . . . and if T is a stopping time forX1,X2, . . ., then

E[ZT ] = E[Z0]

whenever one of the following holds:1 The Zi are bounded, so there is a constant c such that, for all i, |Zi | ≤ c;2 T is bounded;3 E[T ] <∞, and there is a constant c such that E[|Zi+1 − Zi | | X1, . . . ,Xi ] < c.

Nitesh Randomized Algorithms

Page 100: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

IntroductionMartingale Stopping Theorem

Martingale Stopping Theorem

Theorem

If Z0,Z1, . . . is a martingale with respect to X1,X2, . . . and if T is a stopping time forX1,X2, . . ., then

E[ZT ] = E[Z0]

whenever one of the following holds:1 The Zi are bounded, so there is a constant c such that, for all i, |Zi | ≤ c;2 T is bounded;3 E[T ] <∞, and there is a constant c such that E[|Zi+1 − Zi | | X1, . . . ,Xi ] < c.

Nitesh Randomized Algorithms

Page 101: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

IntroductionMartingale Stopping Theorem

Martingale Stopping Theorem

Theorem

If Z0,Z1, . . . is a martingale with respect to X1,X2, . . . and if T is a stopping time forX1,X2, . . ., then

E[ZT ] = E[Z0]

whenever one of the following holds:1 The Zi are bounded, so there is a constant c such that, for all i, |Zi | ≤ c;2 T is bounded;3 E[T ] <∞, and there is a constant c such that E[|Zi+1 − Zi | | X1, . . . ,Xi ] < c.

Nitesh Randomized Algorithms

Page 102: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

IntroductionMartingale Stopping Theorem

Martingale Stopping Theorem

Theorem

If Z0,Z1, . . . is a martingale with respect to X1,X2, . . . and if T is a stopping time forX1,X2, . . ., then

E[ZT ] = E[Z0]

whenever one of the following holds:

1 The Zi are bounded, so there is a constant c such that, for all i, |Zi | ≤ c;2 T is bounded;3 E[T ] <∞, and there is a constant c such that E[|Zi+1 − Zi | | X1, . . . ,Xi ] < c.

Nitesh Randomized Algorithms

Page 103: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

IntroductionMartingale Stopping Theorem

Martingale Stopping Theorem

Theorem

If Z0,Z1, . . . is a martingale with respect to X1,X2, . . . and if T is a stopping time forX1,X2, . . ., then

E[ZT ] = E[Z0]

whenever one of the following holds:1 The Zi are bounded, so there is a constant c such that, for all i, |Zi | ≤ c;

2 T is bounded;3 E[T ] <∞, and there is a constant c such that E[|Zi+1 − Zi | | X1, . . . ,Xi ] < c.

Nitesh Randomized Algorithms

Page 104: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

IntroductionMartingale Stopping Theorem

Martingale Stopping Theorem

Theorem

If Z0,Z1, . . . is a martingale with respect to X1,X2, . . . and if T is a stopping time forX1,X2, . . ., then

E[ZT ] = E[Z0]

whenever one of the following holds:1 The Zi are bounded, so there is a constant c such that, for all i, |Zi | ≤ c;2 T is bounded;

3 E[T ] <∞, and there is a constant c such that E[|Zi+1 − Zi | | X1, . . . ,Xi ] < c.

Nitesh Randomized Algorithms

Page 105: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

IntroductionMartingale Stopping Theorem

Martingale Stopping Theorem

Theorem

If Z0,Z1, . . . is a martingale with respect to X1,X2, . . . and if T is a stopping time forX1,X2, . . ., then

E[ZT ] = E[Z0]

whenever one of the following holds:1 The Zi are bounded, so there is a constant c such that, for all i, |Zi | ≤ c;2 T is bounded;3 E[T ] <∞, and there is a constant c such that E[|Zi+1 − Zi | | X1, . . . ,Xi ] < c.

Nitesh Randomized Algorithms

Page 106: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

IntroductionMartingale Stopping Theorem

Martingale Stopping Theorem

Example - Gambler’s Ruin

Consider a sequence of independent, fair gambling games. In each round, a playerwins a dollar with probability 1/2 or loses a dollar with probability 1/2.Let Z0 = 0, let Xi be the amount won on the i th game, and let Zi be the total won by theplayer after i games. Assume that the player quits the game when she either loses l1dollars or wins l2 dollars. What is the probability that the player wins l2 dollars beforelosing l1 dollars?

Solution

Let T be the first time the player has either won l2 or lost l1. Then T is a stopping timefor X1,X2, . . .. The sequence Z0,Z1, . . . is a martingale, and since the values of Zi areclearly bounded we apply the martingale stopping theorem.

E[ZT ] = 0.

Let q be the probability that the gambler quits playing after winning l2 dollars. Then

E[ZT ] = l2 · q − l1 · (1− q) = 0

gives q =l1

l1 + l2

Nitesh Randomized Algorithms

Page 107: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

IntroductionMartingale Stopping Theorem

Martingale Stopping Theorem

Example - Gambler’s Ruin

Consider a sequence of independent, fair gambling games. In each round, a playerwins a dollar with probability 1/2 or loses a dollar with probability 1/2.Let Z0 = 0, let Xi be the amount won on the i th game, and let Zi be the total won by theplayer after i games. Assume that the player quits the game when she either loses l1dollars or wins l2 dollars. What is the probability that the player wins l2 dollars beforelosing l1 dollars?

Solution

Let T be the first time the player has either won l2 or lost l1. Then T is a stopping timefor X1,X2, . . .. The sequence Z0,Z1, . . . is a martingale, and since the values of Zi areclearly bounded we apply the martingale stopping theorem.

E[ZT ] = 0.

Let q be the probability that the gambler quits playing after winning l2 dollars. Then

E[ZT ] = l2 · q − l1 · (1− q) = 0

gives q =l1

l1 + l2

Nitesh Randomized Algorithms

Page 108: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

IntroductionMartingale Stopping Theorem

Martingale Stopping Theorem

Example - Gambler’s Ruin

Consider a sequence of independent, fair gambling games.

In each round, a playerwins a dollar with probability 1/2 or loses a dollar with probability 1/2.Let Z0 = 0, let Xi be the amount won on the i th game, and let Zi be the total won by theplayer after i games. Assume that the player quits the game when she either loses l1dollars or wins l2 dollars. What is the probability that the player wins l2 dollars beforelosing l1 dollars?

Solution

Let T be the first time the player has either won l2 or lost l1. Then T is a stopping timefor X1,X2, . . .. The sequence Z0,Z1, . . . is a martingale, and since the values of Zi areclearly bounded we apply the martingale stopping theorem.

E[ZT ] = 0.

Let q be the probability that the gambler quits playing after winning l2 dollars. Then

E[ZT ] = l2 · q − l1 · (1− q) = 0

gives q =l1

l1 + l2

Nitesh Randomized Algorithms

Page 109: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

IntroductionMartingale Stopping Theorem

Martingale Stopping Theorem

Example - Gambler’s Ruin

Consider a sequence of independent, fair gambling games. In each round, a playerwins a dollar with probability 1/2 or loses a dollar with probability 1/2.

Let Z0 = 0, let Xi be the amount won on the i th game, and let Zi be the total won by theplayer after i games. Assume that the player quits the game when she either loses l1dollars or wins l2 dollars. What is the probability that the player wins l2 dollars beforelosing l1 dollars?

Solution

Let T be the first time the player has either won l2 or lost l1. Then T is a stopping timefor X1,X2, . . .. The sequence Z0,Z1, . . . is a martingale, and since the values of Zi areclearly bounded we apply the martingale stopping theorem.

E[ZT ] = 0.

Let q be the probability that the gambler quits playing after winning l2 dollars. Then

E[ZT ] = l2 · q − l1 · (1− q) = 0

gives q =l1

l1 + l2

Nitesh Randomized Algorithms

Page 110: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

IntroductionMartingale Stopping Theorem

Martingale Stopping Theorem

Example - Gambler’s Ruin

Consider a sequence of independent, fair gambling games. In each round, a playerwins a dollar with probability 1/2 or loses a dollar with probability 1/2.Let Z0 = 0,

let Xi be the amount won on the i th game, and let Zi be the total won by theplayer after i games. Assume that the player quits the game when she either loses l1dollars or wins l2 dollars. What is the probability that the player wins l2 dollars beforelosing l1 dollars?

Solution

Let T be the first time the player has either won l2 or lost l1. Then T is a stopping timefor X1,X2, . . .. The sequence Z0,Z1, . . . is a martingale, and since the values of Zi areclearly bounded we apply the martingale stopping theorem.

E[ZT ] = 0.

Let q be the probability that the gambler quits playing after winning l2 dollars. Then

E[ZT ] = l2 · q − l1 · (1− q) = 0

gives q =l1

l1 + l2

Nitesh Randomized Algorithms

Page 111: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

IntroductionMartingale Stopping Theorem

Martingale Stopping Theorem

Example - Gambler’s Ruin

Consider a sequence of independent, fair gambling games. In each round, a playerwins a dollar with probability 1/2 or loses a dollar with probability 1/2.Let Z0 = 0, let Xi be the amount won on the i th game, and let Zi be the total won by theplayer after i games.

Assume that the player quits the game when she either loses l1dollars or wins l2 dollars. What is the probability that the player wins l2 dollars beforelosing l1 dollars?

Solution

Let T be the first time the player has either won l2 or lost l1. Then T is a stopping timefor X1,X2, . . .. The sequence Z0,Z1, . . . is a martingale, and since the values of Zi areclearly bounded we apply the martingale stopping theorem.

E[ZT ] = 0.

Let q be the probability that the gambler quits playing after winning l2 dollars. Then

E[ZT ] = l2 · q − l1 · (1− q) = 0

gives q =l1

l1 + l2

Nitesh Randomized Algorithms

Page 112: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

IntroductionMartingale Stopping Theorem

Martingale Stopping Theorem

Example - Gambler’s Ruin

Consider a sequence of independent, fair gambling games. In each round, a playerwins a dollar with probability 1/2 or loses a dollar with probability 1/2.Let Z0 = 0, let Xi be the amount won on the i th game, and let Zi be the total won by theplayer after i games. Assume that the player quits the game when she either loses l1dollars or wins l2 dollars.

What is the probability that the player wins l2 dollars beforelosing l1 dollars?

Solution

Let T be the first time the player has either won l2 or lost l1. Then T is a stopping timefor X1,X2, . . .. The sequence Z0,Z1, . . . is a martingale, and since the values of Zi areclearly bounded we apply the martingale stopping theorem.

E[ZT ] = 0.

Let q be the probability that the gambler quits playing after winning l2 dollars. Then

E[ZT ] = l2 · q − l1 · (1− q) = 0

gives q =l1

l1 + l2

Nitesh Randomized Algorithms

Page 113: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

IntroductionMartingale Stopping Theorem

Martingale Stopping Theorem

Example - Gambler’s Ruin

Consider a sequence of independent, fair gambling games. In each round, a playerwins a dollar with probability 1/2 or loses a dollar with probability 1/2.Let Z0 = 0, let Xi be the amount won on the i th game, and let Zi be the total won by theplayer after i games. Assume that the player quits the game when she either loses l1dollars or wins l2 dollars. What is the probability that the player wins l2 dollars beforelosing l1 dollars?

Solution

Let T be the first time the player has either won l2 or lost l1. Then T is a stopping timefor X1,X2, . . .. The sequence Z0,Z1, . . . is a martingale, and since the values of Zi areclearly bounded we apply the martingale stopping theorem.

E[ZT ] = 0.

Let q be the probability that the gambler quits playing after winning l2 dollars. Then

E[ZT ] = l2 · q − l1 · (1− q) = 0

gives q =l1

l1 + l2

Nitesh Randomized Algorithms

Page 114: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

IntroductionMartingale Stopping Theorem

Martingale Stopping Theorem

Example - Gambler’s Ruin

Consider a sequence of independent, fair gambling games. In each round, a playerwins a dollar with probability 1/2 or loses a dollar with probability 1/2.Let Z0 = 0, let Xi be the amount won on the i th game, and let Zi be the total won by theplayer after i games. Assume that the player quits the game when she either loses l1dollars or wins l2 dollars. What is the probability that the player wins l2 dollars beforelosing l1 dollars?

Solution

Let T be the first time the player has either won l2 or lost l1. Then T is a stopping timefor X1,X2, . . .. The sequence Z0,Z1, . . . is a martingale, and since the values of Zi areclearly bounded we apply the martingale stopping theorem.

E[ZT ] = 0.

Let q be the probability that the gambler quits playing after winning l2 dollars. Then

E[ZT ] = l2 · q − l1 · (1− q) = 0

gives q =l1

l1 + l2

Nitesh Randomized Algorithms

Page 115: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

IntroductionMartingale Stopping Theorem

Martingale Stopping Theorem

Example - Gambler’s Ruin

Consider a sequence of independent, fair gambling games. In each round, a playerwins a dollar with probability 1/2 or loses a dollar with probability 1/2.Let Z0 = 0, let Xi be the amount won on the i th game, and let Zi be the total won by theplayer after i games. Assume that the player quits the game when she either loses l1dollars or wins l2 dollars. What is the probability that the player wins l2 dollars beforelosing l1 dollars?

Solution

Let T be the first time the player has either won l2 or lost l1.

Then T is a stopping timefor X1,X2, . . .. The sequence Z0,Z1, . . . is a martingale, and since the values of Zi areclearly bounded we apply the martingale stopping theorem.

E[ZT ] = 0.

Let q be the probability that the gambler quits playing after winning l2 dollars. Then

E[ZT ] = l2 · q − l1 · (1− q) = 0

gives q =l1

l1 + l2

Nitesh Randomized Algorithms

Page 116: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

IntroductionMartingale Stopping Theorem

Martingale Stopping Theorem

Example - Gambler’s Ruin

Consider a sequence of independent, fair gambling games. In each round, a playerwins a dollar with probability 1/2 or loses a dollar with probability 1/2.Let Z0 = 0, let Xi be the amount won on the i th game, and let Zi be the total won by theplayer after i games. Assume that the player quits the game when she either loses l1dollars or wins l2 dollars. What is the probability that the player wins l2 dollars beforelosing l1 dollars?

Solution

Let T be the first time the player has either won l2 or lost l1. Then T is a stopping timefor X1,X2, . . ..

The sequence Z0,Z1, . . . is a martingale, and since the values of Zi areclearly bounded we apply the martingale stopping theorem.

E[ZT ] = 0.

Let q be the probability that the gambler quits playing after winning l2 dollars. Then

E[ZT ] = l2 · q − l1 · (1− q) = 0

gives q =l1

l1 + l2

Nitesh Randomized Algorithms

Page 117: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

IntroductionMartingale Stopping Theorem

Martingale Stopping Theorem

Example - Gambler’s Ruin

Consider a sequence of independent, fair gambling games. In each round, a playerwins a dollar with probability 1/2 or loses a dollar with probability 1/2.Let Z0 = 0, let Xi be the amount won on the i th game, and let Zi be the total won by theplayer after i games. Assume that the player quits the game when she either loses l1dollars or wins l2 dollars. What is the probability that the player wins l2 dollars beforelosing l1 dollars?

Solution

Let T be the first time the player has either won l2 or lost l1. Then T is a stopping timefor X1,X2, . . .. The sequence Z0,Z1, . . . is a martingale, and since the values of Zi areclearly bounded we apply the martingale stopping theorem.

E[ZT ] = 0.

Let q be the probability that the gambler quits playing after winning l2 dollars. Then

E[ZT ] = l2 · q − l1 · (1− q) = 0

gives q =l1

l1 + l2

Nitesh Randomized Algorithms

Page 118: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

IntroductionMartingale Stopping Theorem

Martingale Stopping Theorem

Example - Gambler’s Ruin

Consider a sequence of independent, fair gambling games. In each round, a playerwins a dollar with probability 1/2 or loses a dollar with probability 1/2.Let Z0 = 0, let Xi be the amount won on the i th game, and let Zi be the total won by theplayer after i games. Assume that the player quits the game when she either loses l1dollars or wins l2 dollars. What is the probability that the player wins l2 dollars beforelosing l1 dollars?

Solution

Let T be the first time the player has either won l2 or lost l1. Then T is a stopping timefor X1,X2, . . .. The sequence Z0,Z1, . . . is a martingale, and since the values of Zi areclearly bounded we apply the martingale stopping theorem.

E[ZT ] = 0.

Let q be the probability that the gambler quits playing after winning l2 dollars. Then

E[ZT ] = l2 · q − l1 · (1− q) = 0

gives q =l1

l1 + l2

Nitesh Randomized Algorithms

Page 119: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

IntroductionMartingale Stopping Theorem

Martingale Stopping Theorem

Example - Gambler’s Ruin

Consider a sequence of independent, fair gambling games. In each round, a playerwins a dollar with probability 1/2 or loses a dollar with probability 1/2.Let Z0 = 0, let Xi be the amount won on the i th game, and let Zi be the total won by theplayer after i games. Assume that the player quits the game when she either loses l1dollars or wins l2 dollars. What is the probability that the player wins l2 dollars beforelosing l1 dollars?

Solution

Let T be the first time the player has either won l2 or lost l1. Then T is a stopping timefor X1,X2, . . .. The sequence Z0,Z1, . . . is a martingale, and since the values of Zi areclearly bounded we apply the martingale stopping theorem.

E[ZT ] = 0.

Let q be the probability that the gambler quits playing after winning l2 dollars. Then

E[ZT ] = l2 · q − l1 · (1− q) = 0

gives q =l1

l1 + l2

Nitesh Randomized Algorithms

Page 120: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

IntroductionMartingale Stopping Theorem

Martingale Stopping Theorem

Example - Gambler’s Ruin

Consider a sequence of independent, fair gambling games. In each round, a playerwins a dollar with probability 1/2 or loses a dollar with probability 1/2.Let Z0 = 0, let Xi be the amount won on the i th game, and let Zi be the total won by theplayer after i games. Assume that the player quits the game when she either loses l1dollars or wins l2 dollars. What is the probability that the player wins l2 dollars beforelosing l1 dollars?

Solution

Let T be the first time the player has either won l2 or lost l1. Then T is a stopping timefor X1,X2, . . .. The sequence Z0,Z1, . . . is a martingale, and since the values of Zi areclearly bounded we apply the martingale stopping theorem.

E[ZT ] = 0.

Let q be the probability that the gambler quits playing after winning l2 dollars. Then

E[ZT ] = l2 · q − l1 · (1− q) = 0

gives q =l1

l1 + l2

Nitesh Randomized Algorithms

Page 121: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

IntroductionMartingale Stopping Theorem

Martingale Stopping Theorem

Example - Gambler’s Ruin

Consider a sequence of independent, fair gambling games. In each round, a playerwins a dollar with probability 1/2 or loses a dollar with probability 1/2.Let Z0 = 0, let Xi be the amount won on the i th game, and let Zi be the total won by theplayer after i games. Assume that the player quits the game when she either loses l1dollars or wins l2 dollars. What is the probability that the player wins l2 dollars beforelosing l1 dollars?

Solution

Let T be the first time the player has either won l2 or lost l1. Then T is a stopping timefor X1,X2, . . .. The sequence Z0,Z1, . . . is a martingale, and since the values of Zi areclearly bounded we apply the martingale stopping theorem.

E[ZT ] = 0.

Let q be the probability that the gambler quits playing after winning l2 dollars. Then

E[ZT ] = l2 · q − l1 · (1− q) = 0

gives q =l1

l1 + l2

Nitesh Randomized Algorithms

Page 122: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

Wald’s Equation

Theorem

Let X1,X2, . . . be a nonnegative, independent, identically distributed random variableswith distribution X . Let T be a stopping time for this sequence. If T and X havebounded expectation, then

E

T∑i=1

Xi

= E[T ] · E[X ].

Proof

For i ≥ 1, let

Zi =i∑

j=1

(Xj − E[X ]).

The sequence Z1,Z2, . . . is a martingale with respect to X1,X2. . . ., and E[Z1] = 0.Now, E[T ] <∞ and

E[|Zi+1 − Zi | | X1, . . . ,Xi ] = E[|Xi+1 − E [X ]|] ≤ 2E[X ].

Nitesh Randomized Algorithms

Page 123: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

Wald’s Equation

Theorem

Let X1,X2, . . . be a nonnegative, independent, identically distributed random variableswith distribution X . Let T be a stopping time for this sequence. If T and X havebounded expectation, then

E

T∑i=1

Xi

= E[T ] · E[X ].

Proof

For i ≥ 1, let

Zi =i∑

j=1

(Xj − E[X ]).

The sequence Z1,Z2, . . . is a martingale with respect to X1,X2. . . ., and E[Z1] = 0.Now, E[T ] <∞ and

E[|Zi+1 − Zi | | X1, . . . ,Xi ] = E[|Xi+1 − E [X ]|] ≤ 2E[X ].

Nitesh Randomized Algorithms

Page 124: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

Wald’s Equation

Theorem

Let X1,X2, . . . be a nonnegative, independent, identically distributed random variableswith distribution X . Let T be a stopping time for this sequence. If T and X havebounded expectation, then

E

T∑i=1

Xi

= E[T ] · E[X ].

Proof

For i ≥ 1, let

Zi =i∑

j=1

(Xj − E[X ]).

The sequence Z1,Z2, . . . is a martingale with respect to X1,X2. . . ., and E[Z1] = 0.Now, E[T ] <∞ and

E[|Zi+1 − Zi | | X1, . . . ,Xi ] = E[|Xi+1 − E [X ]|] ≤ 2E[X ].

Nitesh Randomized Algorithms

Page 125: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

Wald’s Equation

Theorem

Let X1,X2, . . . be a nonnegative, independent, identically distributed random variableswith distribution X . Let T be a stopping time for this sequence. If T and X havebounded expectation, then

E

T∑i=1

Xi

= E[T ] · E[X ].

Proof

For i ≥ 1, let

Zi =i∑

j=1

(Xj − E[X ]).

The sequence Z1,Z2, . . . is a martingale with respect to X1,X2. . . ., and E[Z1] = 0.Now, E[T ] <∞ and

E[|Zi+1 − Zi | | X1, . . . ,Xi ] = E[|Xi+1 − E [X ]|] ≤ 2E[X ].

Nitesh Randomized Algorithms

Page 126: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

Wald’s Equation

Theorem

Let X1,X2, . . . be a nonnegative, independent, identically distributed random variableswith distribution X . Let T be a stopping time for this sequence. If T and X havebounded expectation, then

E

T∑i=1

Xi

= E[T ] · E[X ].

Proof

For i ≥ 1, let

Zi =i∑

j=1

(Xj − E[X ]).

The sequence Z1,Z2, . . . is a martingale with respect to X1,X2. . . ., and E[Z1] = 0.Now, E[T ] <∞ and

E[|Zi+1 − Zi | | X1, . . . ,Xi ] = E[|Xi+1 − E [X ]|] ≤ 2E[X ].

Nitesh Randomized Algorithms

Page 127: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

Wald’s Equation

Theorem

Let X1,X2, . . . be a nonnegative, independent, identically distributed random variableswith distribution X . Let T be a stopping time for this sequence. If T and X havebounded expectation, then

E

T∑i=1

Xi

= E[T ] · E[X ].

Proof

For i ≥ 1, let

Zi =i∑

j=1

(Xj − E[X ]).

The sequence Z1,Z2, . . . is a martingale with respect to X1,X2. . . ., and E[Z1] = 0.

Now, E[T ] <∞ and

E[|Zi+1 − Zi | | X1, . . . ,Xi ] = E[|Xi+1 − E [X ]|] ≤ 2E[X ].

Nitesh Randomized Algorithms

Page 128: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

Wald’s Equation

Theorem

Let X1,X2, . . . be a nonnegative, independent, identically distributed random variableswith distribution X . Let T be a stopping time for this sequence. If T and X havebounded expectation, then

E

T∑i=1

Xi

= E[T ] · E[X ].

Proof

For i ≥ 1, let

Zi =i∑

j=1

(Xj − E[X ]).

The sequence Z1,Z2, . . . is a martingale with respect to X1,X2. . . ., and E[Z1] = 0.Now, E[T ] <∞ and

E[|Zi+1 − Zi | | X1, . . . ,Xi ] = E[|Xi+1 − E [X ]|] ≤ 2E[X ].

Nitesh Randomized Algorithms

Page 129: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

Wald’s Equation

Theorem

Let X1,X2, . . . be a nonnegative, independent, identically distributed random variableswith distribution X . Let T be a stopping time for this sequence. If T and X havebounded expectation, then

E

T∑i=1

Xi

= E[T ] · E[X ].

Proof

For i ≥ 1, let

Zi =i∑

j=1

(Xj − E[X ]).

The sequence Z1,Z2, . . . is a martingale with respect to X1,X2. . . ., and E[Z1] = 0.Now, E[T ] <∞ and

E[|Zi+1 − Zi | | X1, . . . ,Xi ] = E[|Xi+1 − E [X ]|] ≤ 2E[X ].

Nitesh Randomized Algorithms

Page 130: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

Wald’s Equation

Proof

Hence on applying martingale stopping theorem

E[ZT ] = E[Z1] = 0.

we now find

E[ZT ] = E

T∑j=1

(Xj − E[X ])

= E

T∑j=1

Xj

− T · E[X ]

= E

T∑j=1

Xj

− E[T ] · E[X ]

= 0 , which gives the result.

Nitesh Randomized Algorithms

Page 131: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

Wald’s Equation

Proof

Hence on applying martingale stopping theorem

E[ZT ] = E[Z1] = 0.

we now find

E[ZT ] = E

T∑j=1

(Xj − E[X ])

= E

T∑j=1

Xj

− T · E[X ]

= E

T∑j=1

Xj

− E[T ] · E[X ]

= 0 , which gives the result.

Nitesh Randomized Algorithms

Page 132: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

Wald’s Equation

Proof

Hence on applying martingale stopping theorem

E[ZT ] = E[Z1] = 0.

we now find

E[ZT ] = E

T∑j=1

(Xj − E[X ])

= E

T∑j=1

Xj

− T · E[X ]

= E

T∑j=1

Xj

− E[T ] · E[X ]

= 0 , which gives the result.

Nitesh Randomized Algorithms

Page 133: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

Wald’s Equation

Proof

Hence on applying martingale stopping theorem

E[ZT ] = E[Z1] = 0.

we now find

E[ZT ] = E

T∑j=1

(Xj − E[X ])

= E

T∑j=1

Xj

− T · E[X ]

= E

T∑j=1

Xj

− E[T ] · E[X ]

= 0 , which gives the result.

Nitesh Randomized Algorithms

Page 134: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

Wald’s Equation

Proof

Hence on applying martingale stopping theorem

E[ZT ] = E[Z1] = 0.

we now find

E[ZT ] = E

T∑j=1

(Xj − E[X ])

= E

T∑j=1

Xj

− T · E[X ]

= E

T∑j=1

Xj

− E[T ] · E[X ]

= 0 , which gives the result.

Nitesh Randomized Algorithms

Page 135: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

Wald’s Equation

Proof

Hence on applying martingale stopping theorem

E[ZT ] = E[Z1] = 0.

we now find

E[ZT ] = E

T∑j=1

(Xj − E[X ])

= E

T∑j=1

Xj

− T · E[X ]

= E

T∑j=1

Xj

− E[T ] · E[X ]

= 0 , which gives the result.

Nitesh Randomized Algorithms

Page 136: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

Wald’s Equation

Proof

Hence on applying martingale stopping theorem

E[ZT ] = E[Z1] = 0.

we now find

E[ZT ] = E

T∑j=1

(Xj − E[X ])

= E

T∑j=1

Xj

− T · E[X ]

= E

T∑j=1

Xj

− E[T ] · E[X ]

= 0 , which gives the result.

Nitesh Randomized Algorithms

Page 137: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

Wald’s Equation

Proof

Hence on applying martingale stopping theorem

E[ZT ] = E[Z1] = 0.

we now find

E[ZT ] = E

T∑j=1

(Xj − E[X ])

= E

T∑j=1

Xj

− T · E[X ]

= E

T∑j=1

Xj

− E[T ] · E[X ]

= 0 , which gives the result.

Nitesh Randomized Algorithms

Page 138: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

Wald’s Equation

Definition

Let Z0,Z1, . . . be a sequence of independent random variables. A non-negative,integer-valued random variable T is a stopping time for the sequence if the eventT = n is independent of Zn+1,Zn+2,...

Example

Consider a gambling game in which a player first rolls one standard die. If the outcomeof the roll is X then she rolls X new standard dice and her gain Z is the sum of theoutcome of the X dice. What is the outcome of this game?

Solution

For 1 ≤ i ≤ X , let Yi be the outcome of the i th die in the second round. Then

E[Z ] = E

X∑i=1

Yi

= E[X ] · E[Yi ] =

(72

)2=

494

Nitesh Randomized Algorithms

Page 139: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

Wald’s Equation

Definition

Let Z0,Z1, . . . be a sequence of independent random variables. A non-negative,integer-valued random variable T is a stopping time for the sequence if the eventT = n is independent of Zn+1,Zn+2,...

Example

Consider a gambling game in which a player first rolls one standard die. If the outcomeof the roll is X then she rolls X new standard dice and her gain Z is the sum of theoutcome of the X dice. What is the outcome of this game?

Solution

For 1 ≤ i ≤ X , let Yi be the outcome of the i th die in the second round. Then

E[Z ] = E

X∑i=1

Yi

= E[X ] · E[Yi ] =

(72

)2=

494

Nitesh Randomized Algorithms

Page 140: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

Wald’s Equation

Definition

Let Z0,Z1, . . . be a sequence of independent random variables. A non-negative,integer-valued random variable T is a stopping time for the sequence if the eventT = n is independent of Zn+1,Zn+2,...

Example

Consider a gambling game in which a player first rolls one standard die. If the outcomeof the roll is X then she rolls X new standard dice and her gain Z is the sum of theoutcome of the X dice. What is the outcome of this game?

Solution

For 1 ≤ i ≤ X , let Yi be the outcome of the i th die in the second round. Then

E[Z ] = E

X∑i=1

Yi

= E[X ] · E[Yi ] =

(72

)2=

494

Nitesh Randomized Algorithms

Page 141: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

Wald’s Equation

Definition

Let Z0,Z1, . . . be a sequence of independent random variables. A non-negative,integer-valued random variable T is a stopping time for the sequence if the eventT = n is independent of Zn+1,Zn+2,...

Example

Consider a gambling game in which a player first rolls one standard die. If the outcomeof the roll is X then she rolls X new standard dice and her gain Z is the sum of theoutcome of the X dice. What is the outcome of this game?

Solution

For 1 ≤ i ≤ X , let Yi be the outcome of the i th die in the second round. Then

E[Z ] = E

X∑i=1

Yi

= E[X ] · E[Yi ] =

(72

)2=

494

Nitesh Randomized Algorithms

Page 142: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

Wald’s Equation

Definition

Let Z0,Z1, . . . be a sequence of independent random variables. A non-negative,integer-valued random variable T is a stopping time for the sequence if the eventT = n is independent of Zn+1,Zn+2,...

Example

Consider a gambling game in which a player first rolls one standard die.

If the outcomeof the roll is X then she rolls X new standard dice and her gain Z is the sum of theoutcome of the X dice. What is the outcome of this game?

Solution

For 1 ≤ i ≤ X , let Yi be the outcome of the i th die in the second round. Then

E[Z ] = E

X∑i=1

Yi

= E[X ] · E[Yi ] =

(72

)2=

494

Nitesh Randomized Algorithms

Page 143: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

Wald’s Equation

Definition

Let Z0,Z1, . . . be a sequence of independent random variables. A non-negative,integer-valued random variable T is a stopping time for the sequence if the eventT = n is independent of Zn+1,Zn+2,...

Example

Consider a gambling game in which a player first rolls one standard die. If the outcomeof the roll is X then she rolls X new standard dice and her gain Z is the sum of theoutcome of the X dice.

What is the outcome of this game?

Solution

For 1 ≤ i ≤ X , let Yi be the outcome of the i th die in the second round. Then

E[Z ] = E

X∑i=1

Yi

= E[X ] · E[Yi ] =

(72

)2=

494

Nitesh Randomized Algorithms

Page 144: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

Wald’s Equation

Definition

Let Z0,Z1, . . . be a sequence of independent random variables. A non-negative,integer-valued random variable T is a stopping time for the sequence if the eventT = n is independent of Zn+1,Zn+2,...

Example

Consider a gambling game in which a player first rolls one standard die. If the outcomeof the roll is X then she rolls X new standard dice and her gain Z is the sum of theoutcome of the X dice. What is the outcome of this game?

Solution

For 1 ≤ i ≤ X , let Yi be the outcome of the i th die in the second round. Then

E[Z ] = E

X∑i=1

Yi

= E[X ] · E[Yi ] =

(72

)2=

494

Nitesh Randomized Algorithms

Page 145: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

Wald’s Equation

Definition

Let Z0,Z1, . . . be a sequence of independent random variables. A non-negative,integer-valued random variable T is a stopping time for the sequence if the eventT = n is independent of Zn+1,Zn+2,...

Example

Consider a gambling game in which a player first rolls one standard die. If the outcomeof the roll is X then she rolls X new standard dice and her gain Z is the sum of theoutcome of the X dice. What is the outcome of this game?

Solution

For 1 ≤ i ≤ X , let Yi be the outcome of the i th die in the second round. Then

E[Z ] = E

X∑i=1

Yi

= E[X ] · E[Yi ] =

(72

)2=

494

Nitesh Randomized Algorithms

Page 146: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

Wald’s Equation

Definition

Let Z0,Z1, . . . be a sequence of independent random variables. A non-negative,integer-valued random variable T is a stopping time for the sequence if the eventT = n is independent of Zn+1,Zn+2,...

Example

Consider a gambling game in which a player first rolls one standard die. If the outcomeof the roll is X then she rolls X new standard dice and her gain Z is the sum of theoutcome of the X dice. What is the outcome of this game?

Solution

For 1 ≤ i ≤ X , let Yi be the outcome of the i th die in the second round. Then

E[Z ] = E

X∑i=1

Yi

= E[X ] · E[Yi ] =

(72

)2=

494

Nitesh Randomized Algorithms

Page 147: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

Wald’s Equation

Definition

Let Z0,Z1, . . . be a sequence of independent random variables. A non-negative,integer-valued random variable T is a stopping time for the sequence if the eventT = n is independent of Zn+1,Zn+2,...

Example

Consider a gambling game in which a player first rolls one standard die. If the outcomeof the roll is X then she rolls X new standard dice and her gain Z is the sum of theoutcome of the X dice. What is the outcome of this game?

Solution

For 1 ≤ i ≤ X , let Yi be the outcome of the i th die in the second round. Then

E[Z ] = E

X∑i=1

Yi

=

E[X ] · E[Yi ] =

(72

)2=

494

Nitesh Randomized Algorithms

Page 148: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

Wald’s Equation

Definition

Let Z0,Z1, . . . be a sequence of independent random variables. A non-negative,integer-valued random variable T is a stopping time for the sequence if the eventT = n is independent of Zn+1,Zn+2,...

Example

Consider a gambling game in which a player first rolls one standard die. If the outcomeof the roll is X then she rolls X new standard dice and her gain Z is the sum of theoutcome of the X dice. What is the outcome of this game?

Solution

For 1 ≤ i ≤ X , let Yi be the outcome of the i th die in the second round. Then

E[Z ] = E

X∑i=1

Yi

= E[X ] · E[Yi ] =

(72

)2=

494

Nitesh Randomized Algorithms

Page 149: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

Wald’s Equation

Definition

Let Z0,Z1, . . . be a sequence of independent random variables. A non-negative,integer-valued random variable T is a stopping time for the sequence if the eventT = n is independent of Zn+1,Zn+2,...

Example

Consider a gambling game in which a player first rolls one standard die. If the outcomeof the roll is X then she rolls X new standard dice and her gain Z is the sum of theoutcome of the X dice. What is the outcome of this game?

Solution

For 1 ≤ i ≤ X , let Yi be the outcome of the i th die in the second round. Then

E[Z ] = E

X∑i=1

Yi

= E[X ] · E[Yi ] =

(72

)2=

494

Nitesh Randomized Algorithms

Page 150: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

Wald’s Equation

Las Vegas algorithms

Las Vegas algorithms are the algorithms that always give the right answer but havevariable running times. In a Las Vegas algorithm we often repeatedly perform somerandomized subroutine that may or may not return the right answer. We then use somedeterministic checking subroutine to determine whether or not the answer is correct; ifcorrect the Las Vegas algorithm terminates with the correct answer, and otherwise therandomized subroutine is run again.

Application

Wald’s equation can be used in the analysis of Las Vegas algorithms. If N is thenumber of trials until a correct answer is found and Xi is the running time for the twosubroutines on the i th trial, then according to Wald’s equation

E

N∑i=1

Xi

= E[N] · E[X ].

Nitesh Randomized Algorithms

Page 151: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

Wald’s Equation

Las Vegas algorithms

Las Vegas algorithms are the algorithms that always give the right answer but havevariable running times. In a Las Vegas algorithm we often repeatedly perform somerandomized subroutine that may or may not return the right answer. We then use somedeterministic checking subroutine to determine whether or not the answer is correct; ifcorrect the Las Vegas algorithm terminates with the correct answer, and otherwise therandomized subroutine is run again.

Application

Wald’s equation can be used in the analysis of Las Vegas algorithms. If N is thenumber of trials until a correct answer is found and Xi is the running time for the twosubroutines on the i th trial, then according to Wald’s equation

E

N∑i=1

Xi

= E[N] · E[X ].

Nitesh Randomized Algorithms

Page 152: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

Wald’s Equation

Las Vegas algorithms

Las Vegas algorithms are the algorithms that always give the right answer but havevariable running times.

In a Las Vegas algorithm we often repeatedly perform somerandomized subroutine that may or may not return the right answer. We then use somedeterministic checking subroutine to determine whether or not the answer is correct; ifcorrect the Las Vegas algorithm terminates with the correct answer, and otherwise therandomized subroutine is run again.

Application

Wald’s equation can be used in the analysis of Las Vegas algorithms. If N is thenumber of trials until a correct answer is found and Xi is the running time for the twosubroutines on the i th trial, then according to Wald’s equation

E

N∑i=1

Xi

= E[N] · E[X ].

Nitesh Randomized Algorithms

Page 153: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

Wald’s Equation

Las Vegas algorithms

Las Vegas algorithms are the algorithms that always give the right answer but havevariable running times. In a Las Vegas algorithm we often repeatedly perform somerandomized subroutine that may or may not return the right answer.

We then use somedeterministic checking subroutine to determine whether or not the answer is correct; ifcorrect the Las Vegas algorithm terminates with the correct answer, and otherwise therandomized subroutine is run again.

Application

Wald’s equation can be used in the analysis of Las Vegas algorithms. If N is thenumber of trials until a correct answer is found and Xi is the running time for the twosubroutines on the i th trial, then according to Wald’s equation

E

N∑i=1

Xi

= E[N] · E[X ].

Nitesh Randomized Algorithms

Page 154: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

Wald’s Equation

Las Vegas algorithms

Las Vegas algorithms are the algorithms that always give the right answer but havevariable running times. In a Las Vegas algorithm we often repeatedly perform somerandomized subroutine that may or may not return the right answer. We then use somedeterministic checking subroutine to determine whether or not the answer is correct;

ifcorrect the Las Vegas algorithm terminates with the correct answer, and otherwise therandomized subroutine is run again.

Application

Wald’s equation can be used in the analysis of Las Vegas algorithms. If N is thenumber of trials until a correct answer is found and Xi is the running time for the twosubroutines on the i th trial, then according to Wald’s equation

E

N∑i=1

Xi

= E[N] · E[X ].

Nitesh Randomized Algorithms

Page 155: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

Wald’s Equation

Las Vegas algorithms

Las Vegas algorithms are the algorithms that always give the right answer but havevariable running times. In a Las Vegas algorithm we often repeatedly perform somerandomized subroutine that may or may not return the right answer. We then use somedeterministic checking subroutine to determine whether or not the answer is correct; ifcorrect the Las Vegas algorithm terminates with the correct answer, and

otherwise therandomized subroutine is run again.

Application

Wald’s equation can be used in the analysis of Las Vegas algorithms. If N is thenumber of trials until a correct answer is found and Xi is the running time for the twosubroutines on the i th trial, then according to Wald’s equation

E

N∑i=1

Xi

= E[N] · E[X ].

Nitesh Randomized Algorithms

Page 156: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

Wald’s Equation

Las Vegas algorithms

Las Vegas algorithms are the algorithms that always give the right answer but havevariable running times. In a Las Vegas algorithm we often repeatedly perform somerandomized subroutine that may or may not return the right answer. We then use somedeterministic checking subroutine to determine whether or not the answer is correct; ifcorrect the Las Vegas algorithm terminates with the correct answer, and otherwise therandomized subroutine is run again.

Application

Wald’s equation can be used in the analysis of Las Vegas algorithms. If N is thenumber of trials until a correct answer is found and Xi is the running time for the twosubroutines on the i th trial, then according to Wald’s equation

E

N∑i=1

Xi

= E[N] · E[X ].

Nitesh Randomized Algorithms

Page 157: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

Wald’s Equation

Las Vegas algorithms

Las Vegas algorithms are the algorithms that always give the right answer but havevariable running times. In a Las Vegas algorithm we often repeatedly perform somerandomized subroutine that may or may not return the right answer. We then use somedeterministic checking subroutine to determine whether or not the answer is correct; ifcorrect the Las Vegas algorithm terminates with the correct answer, and otherwise therandomized subroutine is run again.

Application

Wald’s equation can be used in the analysis of Las Vegas algorithms. If N is thenumber of trials until a correct answer is found and Xi is the running time for the twosubroutines on the i th trial, then according to Wald’s equation

E

N∑i=1

Xi

= E[N] · E[X ].

Nitesh Randomized Algorithms

Page 158: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

Wald’s Equation

Las Vegas algorithms

Las Vegas algorithms are the algorithms that always give the right answer but havevariable running times. In a Las Vegas algorithm we often repeatedly perform somerandomized subroutine that may or may not return the right answer. We then use somedeterministic checking subroutine to determine whether or not the answer is correct; ifcorrect the Las Vegas algorithm terminates with the correct answer, and otherwise therandomized subroutine is run again.

Application

Wald’s equation can be used in the analysis of Las Vegas algorithms.

If N is thenumber of trials until a correct answer is found and Xi is the running time for the twosubroutines on the i th trial, then according to Wald’s equation

E

N∑i=1

Xi

= E[N] · E[X ].

Nitesh Randomized Algorithms

Page 159: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

Wald’s Equation

Las Vegas algorithms

Las Vegas algorithms are the algorithms that always give the right answer but havevariable running times. In a Las Vegas algorithm we often repeatedly perform somerandomized subroutine that may or may not return the right answer. We then use somedeterministic checking subroutine to determine whether or not the answer is correct; ifcorrect the Las Vegas algorithm terminates with the correct answer, and otherwise therandomized subroutine is run again.

Application

Wald’s equation can be used in the analysis of Las Vegas algorithms. If N is thenumber of trials until a correct answer is found and Xi is the running time for the twosubroutines on the i th trial, then according to Wald’s equation

E

N∑i=1

Xi

= E[N] · E[X ].

Nitesh Randomized Algorithms

Page 160: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

Wald’s Equation

Las Vegas algorithms

Las Vegas algorithms are the algorithms that always give the right answer but havevariable running times. In a Las Vegas algorithm we often repeatedly perform somerandomized subroutine that may or may not return the right answer. We then use somedeterministic checking subroutine to determine whether or not the answer is correct; ifcorrect the Las Vegas algorithm terminates with the correct answer, and otherwise therandomized subroutine is run again.

Application

Wald’s equation can be used in the analysis of Las Vegas algorithms. If N is thenumber of trials until a correct answer is found and Xi is the running time for the twosubroutines on the i th trial, then according to Wald’s equation

E

N∑i=1

Xi

= E[N] · E[X ].

Nitesh Randomized Algorithms

Page 161: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

Wald’s Equation

Example

Consider a set of n servers communicating through a shared channel. Time is dividedinto discrete slots. At each time slot, any server that needs to send a packet cantransmit it through the channel. If exactly one packet is sent at a time, the transmissionis successfully completed. If more than one packet is sent, then none are successful.Packets are stored in the server’s buffer until they are successfully transmitted.At each time slot, if the server’s buffer is not empty then with probability 1/n it attemptsto send the first packet in its buffer. What is the expected number of time slots useduntil each server successfully sends at least one packet?

Solution

Let N be the number of packets successfully sent until each server has successfullysent at least one packet. Let ti be the time slot in which the i th successfully transmittedpacket is sent, starting from time t0 = 0, and let ri = ti − ti−1 and let T be the numberof time slots until each server successfully sends at least one packet, then

T =N∑

i=1

ri

Nitesh Randomized Algorithms

Page 162: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

Wald’s Equation

Example

Consider a set of n servers communicating through a shared channel. Time is dividedinto discrete slots. At each time slot, any server that needs to send a packet cantransmit it through the channel. If exactly one packet is sent at a time, the transmissionis successfully completed. If more than one packet is sent, then none are successful.Packets are stored in the server’s buffer until they are successfully transmitted.At each time slot, if the server’s buffer is not empty then with probability 1/n it attemptsto send the first packet in its buffer. What is the expected number of time slots useduntil each server successfully sends at least one packet?

Solution

Let N be the number of packets successfully sent until each server has successfullysent at least one packet. Let ti be the time slot in which the i th successfully transmittedpacket is sent, starting from time t0 = 0, and let ri = ti − ti−1 and let T be the numberof time slots until each server successfully sends at least one packet, then

T =N∑

i=1

ri

Nitesh Randomized Algorithms

Page 163: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

Wald’s Equation

Example

Consider a set of n servers communicating through a shared channel. Time is dividedinto discrete slots. At each time slot, any server that needs to send a packet cantransmit it through the channel.

If exactly one packet is sent at a time, the transmissionis successfully completed. If more than one packet is sent, then none are successful.Packets are stored in the server’s buffer until they are successfully transmitted.At each time slot, if the server’s buffer is not empty then with probability 1/n it attemptsto send the first packet in its buffer. What is the expected number of time slots useduntil each server successfully sends at least one packet?

Solution

Let N be the number of packets successfully sent until each server has successfullysent at least one packet. Let ti be the time slot in which the i th successfully transmittedpacket is sent, starting from time t0 = 0, and let ri = ti − ti−1 and let T be the numberof time slots until each server successfully sends at least one packet, then

T =N∑

i=1

ri

Nitesh Randomized Algorithms

Page 164: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

Wald’s Equation

Example

Consider a set of n servers communicating through a shared channel. Time is dividedinto discrete slots. At each time slot, any server that needs to send a packet cantransmit it through the channel. If exactly one packet is sent at a time, the transmissionis successfully completed. If more than one packet is sent, then none are successful.Packets are stored in the server’s buffer until they are successfully transmitted.

At each time slot, if the server’s buffer is not empty then with probability 1/n it attemptsto send the first packet in its buffer. What is the expected number of time slots useduntil each server successfully sends at least one packet?

Solution

Let N be the number of packets successfully sent until each server has successfullysent at least one packet. Let ti be the time slot in which the i th successfully transmittedpacket is sent, starting from time t0 = 0, and let ri = ti − ti−1 and let T be the numberof time slots until each server successfully sends at least one packet, then

T =N∑

i=1

ri

Nitesh Randomized Algorithms

Page 165: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

Wald’s Equation

Example

Consider a set of n servers communicating through a shared channel. Time is dividedinto discrete slots. At each time slot, any server that needs to send a packet cantransmit it through the channel. If exactly one packet is sent at a time, the transmissionis successfully completed. If more than one packet is sent, then none are successful.Packets are stored in the server’s buffer until they are successfully transmitted.At each time slot, if the server’s buffer is not empty then with probability 1/n it attemptsto send the first packet in its buffer.

What is the expected number of time slots useduntil each server successfully sends at least one packet?

Solution

Let N be the number of packets successfully sent until each server has successfullysent at least one packet. Let ti be the time slot in which the i th successfully transmittedpacket is sent, starting from time t0 = 0, and let ri = ti − ti−1 and let T be the numberof time slots until each server successfully sends at least one packet, then

T =N∑

i=1

ri

Nitesh Randomized Algorithms

Page 166: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

Wald’s Equation

Example

Consider a set of n servers communicating through a shared channel. Time is dividedinto discrete slots. At each time slot, any server that needs to send a packet cantransmit it through the channel. If exactly one packet is sent at a time, the transmissionis successfully completed. If more than one packet is sent, then none are successful.Packets are stored in the server’s buffer until they are successfully transmitted.At each time slot, if the server’s buffer is not empty then with probability 1/n it attemptsto send the first packet in its buffer. What is the expected number of time slots useduntil each server successfully sends at least one packet?

Solution

Let N be the number of packets successfully sent until each server has successfullysent at least one packet. Let ti be the time slot in which the i th successfully transmittedpacket is sent, starting from time t0 = 0, and let ri = ti − ti−1 and let T be the numberof time slots until each server successfully sends at least one packet, then

T =N∑

i=1

ri

Nitesh Randomized Algorithms

Page 167: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

Wald’s Equation

Example

Consider a set of n servers communicating through a shared channel. Time is dividedinto discrete slots. At each time slot, any server that needs to send a packet cantransmit it through the channel. If exactly one packet is sent at a time, the transmissionis successfully completed. If more than one packet is sent, then none are successful.Packets are stored in the server’s buffer until they are successfully transmitted.At each time slot, if the server’s buffer is not empty then with probability 1/n it attemptsto send the first packet in its buffer. What is the expected number of time slots useduntil each server successfully sends at least one packet?

Solution

Let N be the number of packets successfully sent until each server has successfullysent at least one packet. Let ti be the time slot in which the i th successfully transmittedpacket is sent, starting from time t0 = 0, and let ri = ti − ti−1 and let T be the numberof time slots until each server successfully sends at least one packet, then

T =N∑

i=1

ri

Nitesh Randomized Algorithms

Page 168: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

Wald’s Equation

Example

Consider a set of n servers communicating through a shared channel. Time is dividedinto discrete slots. At each time slot, any server that needs to send a packet cantransmit it through the channel. If exactly one packet is sent at a time, the transmissionis successfully completed. If more than one packet is sent, then none are successful.Packets are stored in the server’s buffer until they are successfully transmitted.At each time slot, if the server’s buffer is not empty then with probability 1/n it attemptsto send the first packet in its buffer. What is the expected number of time slots useduntil each server successfully sends at least one packet?

Solution

Let N be the number of packets successfully sent until each server has successfullysent at least one packet.

Let ti be the time slot in which the i th successfully transmittedpacket is sent, starting from time t0 = 0, and let ri = ti − ti−1 and let T be the numberof time slots until each server successfully sends at least one packet, then

T =N∑

i=1

ri

Nitesh Randomized Algorithms

Page 169: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

Wald’s Equation

Example

Consider a set of n servers communicating through a shared channel. Time is dividedinto discrete slots. At each time slot, any server that needs to send a packet cantransmit it through the channel. If exactly one packet is sent at a time, the transmissionis successfully completed. If more than one packet is sent, then none are successful.Packets are stored in the server’s buffer until they are successfully transmitted.At each time slot, if the server’s buffer is not empty then with probability 1/n it attemptsto send the first packet in its buffer. What is the expected number of time slots useduntil each server successfully sends at least one packet?

Solution

Let N be the number of packets successfully sent until each server has successfullysent at least one packet. Let ti be the time slot in which the i th successfully transmittedpacket is sent,

starting from time t0 = 0, and let ri = ti − ti−1 and let T be the numberof time slots until each server successfully sends at least one packet, then

T =N∑

i=1

ri

Nitesh Randomized Algorithms

Page 170: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

Wald’s Equation

Example

Consider a set of n servers communicating through a shared channel. Time is dividedinto discrete slots. At each time slot, any server that needs to send a packet cantransmit it through the channel. If exactly one packet is sent at a time, the transmissionis successfully completed. If more than one packet is sent, then none are successful.Packets are stored in the server’s buffer until they are successfully transmitted.At each time slot, if the server’s buffer is not empty then with probability 1/n it attemptsto send the first packet in its buffer. What is the expected number of time slots useduntil each server successfully sends at least one packet?

Solution

Let N be the number of packets successfully sent until each server has successfullysent at least one packet. Let ti be the time slot in which the i th successfully transmittedpacket is sent, starting from time t0 = 0, and let ri = ti − ti−1 and

let T be the numberof time slots until each server successfully sends at least one packet, then

T =N∑

i=1

ri

Nitesh Randomized Algorithms

Page 171: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

Wald’s Equation

Example

Consider a set of n servers communicating through a shared channel. Time is dividedinto discrete slots. At each time slot, any server that needs to send a packet cantransmit it through the channel. If exactly one packet is sent at a time, the transmissionis successfully completed. If more than one packet is sent, then none are successful.Packets are stored in the server’s buffer until they are successfully transmitted.At each time slot, if the server’s buffer is not empty then with probability 1/n it attemptsto send the first packet in its buffer. What is the expected number of time slots useduntil each server successfully sends at least one packet?

Solution

Let N be the number of packets successfully sent until each server has successfullysent at least one packet. Let ti be the time slot in which the i th successfully transmittedpacket is sent, starting from time t0 = 0, and let ri = ti − ti−1 and let T be the numberof time slots until each server successfully sends at least one packet, then

T =N∑

i=1

ri

Nitesh Randomized Algorithms

Page 172: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

Wald’s Equation

Example

Consider a set of n servers communicating through a shared channel. Time is dividedinto discrete slots. At each time slot, any server that needs to send a packet cantransmit it through the channel. If exactly one packet is sent at a time, the transmissionis successfully completed. If more than one packet is sent, then none are successful.Packets are stored in the server’s buffer until they are successfully transmitted.At each time slot, if the server’s buffer is not empty then with probability 1/n it attemptsto send the first packet in its buffer. What is the expected number of time slots useduntil each server successfully sends at least one packet?

Solution

Let N be the number of packets successfully sent until each server has successfullysent at least one packet. Let ti be the time slot in which the i th successfully transmittedpacket is sent, starting from time t0 = 0, and let ri = ti − ti−1 and let T be the numberof time slots until each server successfully sends at least one packet, then

T =N∑

i=1

ri

Nitesh Randomized Algorithms

Page 173: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

Wald’s Equation

Solution

The probability that a packet is successfully sent in a given time slot is

p =

(n1

)·(

1n

)·(

1−1n

)n−1≈ e−1

The ri each have a geometric distribution with parameter p, so E[ri ] = 1/p ≈ e.Given that a packet was successfully sent at a given time slot, the sender of that packetis uniformly distributed among the n servers, independent of previous steps. FromCoupon collector’s problem, we deduce that

E[N] = n · Hn = n · ln n + O(n).

Nitesh Randomized Algorithms

Page 174: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

Wald’s Equation

Solution

The probability that a packet is successfully sent in a given time slot is

p =

(n1

)·(

1n

)·(

1−1n

)n−1≈ e−1

The ri each have a geometric distribution with parameter p, so E[ri ] = 1/p ≈ e.Given that a packet was successfully sent at a given time slot, the sender of that packetis uniformly distributed among the n servers, independent of previous steps. FromCoupon collector’s problem, we deduce that

E[N] = n · Hn = n · ln n + O(n).

Nitesh Randomized Algorithms

Page 175: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

Wald’s Equation

Solution

The probability that a packet is successfully sent in a given time slot is

p =

(n1

)·(

1n

)·(

1−1n

)n−1≈ e−1

The ri each have a geometric distribution with parameter p, so E[ri ] = 1/p ≈ e.Given that a packet was successfully sent at a given time slot, the sender of that packetis uniformly distributed among the n servers, independent of previous steps. FromCoupon collector’s problem, we deduce that

E[N] = n · Hn = n · ln n + O(n).

Nitesh Randomized Algorithms

Page 176: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

Wald’s Equation

Solution

The probability that a packet is successfully sent in a given time slot is

p =

(n1

)·(

1n

)·(

1−1n

)n−1≈ e−1

The ri each have a geometric distribution with parameter p, so E[ri ] = 1/p ≈ e.Given that a packet was successfully sent at a given time slot, the sender of that packetis uniformly distributed among the n servers, independent of previous steps. FromCoupon collector’s problem, we deduce that

E[N] = n · Hn = n · ln n + O(n).

Nitesh Randomized Algorithms

Page 177: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

Wald’s Equation

Solution

The probability that a packet is successfully sent in a given time slot is

p =

(n1

)·(

1n

)·(

1−1n

)n−1≈ e−1

The ri each have a geometric distribution with parameter p, so E[ri ] =

1/p ≈ e.Given that a packet was successfully sent at a given time slot, the sender of that packetis uniformly distributed among the n servers, independent of previous steps. FromCoupon collector’s problem, we deduce that

E[N] = n · Hn = n · ln n + O(n).

Nitesh Randomized Algorithms

Page 178: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

Wald’s Equation

Solution

The probability that a packet is successfully sent in a given time slot is

p =

(n1

)·(

1n

)·(

1−1n

)n−1≈ e−1

The ri each have a geometric distribution with parameter p, so E[ri ] = 1/p ≈ e.

Given that a packet was successfully sent at a given time slot, the sender of that packetis uniformly distributed among the n servers, independent of previous steps. FromCoupon collector’s problem, we deduce that

E[N] = n · Hn = n · ln n + O(n).

Nitesh Randomized Algorithms

Page 179: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

Wald’s Equation

Solution

The probability that a packet is successfully sent in a given time slot is

p =

(n1

)·(

1n

)·(

1−1n

)n−1≈ e−1

The ri each have a geometric distribution with parameter p, so E[ri ] = 1/p ≈ e.Given that a packet was successfully sent at a given time slot, the sender of that packetis uniformly distributed among the n servers, independent of previous steps.

FromCoupon collector’s problem, we deduce that

E[N] = n · Hn = n · ln n + O(n).

Nitesh Randomized Algorithms

Page 180: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

Wald’s Equation

Solution

The probability that a packet is successfully sent in a given time slot is

p =

(n1

)·(

1n

)·(

1−1n

)n−1≈ e−1

The ri each have a geometric distribution with parameter p, so E[ri ] = 1/p ≈ e.Given that a packet was successfully sent at a given time slot, the sender of that packetis uniformly distributed among the n servers, independent of previous steps. FromCoupon collector’s problem, we deduce that

E[N] = n · Hn = n · ln n + O(n).

Nitesh Randomized Algorithms

Page 181: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

Wald’s Equation

Solution

The probability that a packet is successfully sent in a given time slot is

p =

(n1

)·(

1n

)·(

1−1n

)n−1≈ e−1

The ri each have a geometric distribution with parameter p, so E[ri ] = 1/p ≈ e.Given that a packet was successfully sent at a given time slot, the sender of that packetis uniformly distributed among the n servers, independent of previous steps. FromCoupon collector’s problem, we deduce that

E[N] = n · Hn = n · ln n + O(n).

Nitesh Randomized Algorithms

Page 182: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

Wald’s Equation

Solution

The probability that a packet is successfully sent in a given time slot is

p =

(n1

)·(

1n

)·(

1−1n

)n−1≈ e−1

The ri each have a geometric distribution with parameter p, so E[ri ] = 1/p ≈ e.Given that a packet was successfully sent at a given time slot, the sender of that packetis uniformly distributed among the n servers, independent of previous steps. FromCoupon collector’s problem, we deduce that

E[N] = n · Hn = n · ln n + O(n).

Nitesh Randomized Algorithms

Page 183: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

Wald’s Equation

Solution

Using Wald’s equation we compute

E[T ] = E

N∑i=1

ri

= E[N] · E[ri ]

=n · Hn

p≈ e · n · ln n

Nitesh Randomized Algorithms

Page 184: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

Wald’s Equation

Solution

Using Wald’s equation we compute

E[T ] = E

N∑i=1

ri

= E[N] · E[ri ]

=n · Hn

p≈ e · n · ln n

Nitesh Randomized Algorithms

Page 185: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

Wald’s Equation

Solution

Using Wald’s equation we compute

E[T ] = E

N∑i=1

ri

= E[N] · E[ri ]

=n · Hn

p≈ e · n · ln n

Nitesh Randomized Algorithms

Page 186: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

Wald’s Equation

Solution

Using Wald’s equation we compute

E[T ] = E

N∑i=1

ri

= E[N] · E[ri ]

=n · Hn

p≈ e · n · ln n

Nitesh Randomized Algorithms

Page 187: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

Wald’s Equation

Solution

Using Wald’s equation we compute

E[T ] = E

N∑i=1

ri

= E[N] · E[ri ]

=n · Hn

p≈ e · n · ln n

Nitesh Randomized Algorithms

Page 188: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

Wald’s Equation

Solution

Using Wald’s equation we compute

E[T ] = E

N∑i=1

ri

= E[N] · E[ri ]

=n · Hn

p

≈ e · n · ln n

Nitesh Randomized Algorithms

Page 189: Martingales - West Virginia University

MartingalesStopping TimesWald’s Equation

Wald’s Equation

Solution

Using Wald’s equation we compute

E[T ] = E

N∑i=1

ri

= E[N] · E[ri ]

=n · Hn

p≈ e · n · ln n

Nitesh Randomized Algorithms