1 of 53

Probability

3.2 More on Expectation

Alex Tsun

2 of 53

Agenda

  • Linearity of Expectation (LoE)
  • Law of the Unconscious Statistician (Lotus)

3 of 53

Linearity of Expectation (Idea)

Let’s say you and your friend sell fish for a living.

  • Every day you catch X fish, with E[X] = 3.
  • Every day your friend catches Y fish, with E[Y] = 7.

how many fish do the two of you bring in (Z = X + Y) on an average day?

E[Z] = E[X + Y] = e[X] + E[Y] = 3 + 7 = 10

You can sell each fish for $5 at a store, but you need to pay $20 in rent. How much profit do you expect to make? E[5Z - 20] = 5E[Z] - 20 = 5 x 10 - 20 = 30

4 of 53

Linearity of Expectation (Idea)

Let’s say you and your friend sell fish for a living.

  • Every day you catch X fish, with E[X] = 3.
  • Every day your friend catches Y fish, with E[Y] = 7.

how many fish do the two of you bring in (Z = X + Y) on an average day?

E[Z] = E[X + Y] = e[X] + E[Y] = 3 + 7 = 10

You can sell each fish for $5 at a store, but you need to pay $20 in rent. How much profit do you expect to make? E[5Z - 20] = 5E[Z] - 20 = 5 x 10 - 20 = 30

5 of 53

Linearity of Expectation (Idea)

Let’s say you and your friend sell fish for a living.

  • Every day you catch X fish, with E[X] = 3.
  • Every day your friend catches Y fish, with E[Y] = 7.

how many fish do the two of you bring in (Z = X + Y) on an average day?

E[Z] = E[X + Y] = e[X] + E[Y] = 3 + 7 = 10

You can sell each fish for $5 at a store, but you need to pay $20 in rent. How much profit do you expect to make? E[5Z - 20] = 5E[Z] - 20 = 5 x 10 - 20 = 30

6 of 53

Linearity of Expectation (Idea)

Let’s say you and your friend sell fish for a living.

  • Every day you catch X fish, with E[X] = 3.
  • Every day your friend catches Y fish, with E[Y] = 7.

how many fish do the two of you bring in (Z = X + Y) on an average day?

E[Z] = E[X + Y] = e[X] + E[Y] = 3 + 7 = 10

You can sell each fish for $5 at a store, but you need to pay $20 in rent. How much profit do you expect to make? E[5Z - 20] = 5E[Z] - 20 = 5 x 10 - 20 = 30

7 of 53

Linearity of Expectation (Idea)

Let’s say you and your friend sell fish for a living.

  • Every day you catch X fish, with E[X] = 3.
  • Every day your friend catches Y fish, with E[Y] = 7.

how many fish do the two of you bring in (Z = X + Y) on an average day?

E[Z] = E[X + Y] = e[X] + E[Y] = 3 + 7 = 10

You can sell each fish for $5 at a store, but you need to pay $20 in rent. How much profit do you expect to make? E[5Z - 20] = 5E[Z] - 20 = 5 x 10 - 20 = 30

8 of 53

Linearity of Expectation (Idea)

Let’s say you and your friend sell fish for a living.

  • Every day you catch X fish, with E[X] = 3.
  • Every day your friend catches Y fish, with E[Y] = 7.

how many fish do the two of you bring in (Z = X + Y) on an average day?

E[Z] = E[X + Y] = e[X] + E[Y] = 3 + 7 = 10

You can sell each fish for $5 at a store, but you need to pay $20 in rent. How much profit do you expect to make? E[5Z - 20] = 5E[Z] - 20 = 5 x 10 - 20 = 30

9 of 53

Linearity of Expectation (Idea)

Let’s say you and your friend sell fish for a living.

  • Every day you catch X fish, with E[X] = 3.
  • Every day your friend catches Y fish, with E[Y] = 7.

how many fish do the two of you bring in (Z = X + Y) on an average day?

E[Z] = E[X + Y] = e[X] + E[Y] = 3 + 7 = 10

You can sell each fish for $5 at a store, but you need to pay $20 in rent. How much profit do you expect to make? E[5Z - 20] = 5E[Z] - 20 = 5 x 10 - 20 = 30

10 of 53

Linearity of Expectation (Idea)

Let’s say you and your friend sell fish for a living.

  • Every day you catch X fish, with E[X] = 3.
  • Every day your friend catches Y fish, with E[Y] = 7.

how many fish do the two of you bring in (Z = X + Y) on an average day?

E[Z] = E[X + Y] = e[X] + E[Y] = 3 + 7 = 10

You can sell each fish for $5 at a store, but you need to pay $20 in rent. How much profit do you expect to make? E[5Z - 20] = 5E[Z] - 20 = 5 x 10 - 20 = 30

11 of 53

Linearity of Expectation (Idea)

Let’s say you and your friend sell fish for a living.

  • Every day you catch X fish, with E[X] = 3.
  • Every day your friend catches Y fish, with E[Y] = 7.

how many fish do the two of you bring in (Z = X + Y) on an average day?

E[Z] = E[X + Y] = e[X] + E[Y] = 3 + 7 = 10

You can sell each fish for $5 at a store, but you need to pay $20 in rent. How much profit do you expect to make? E[5Z - 20] = 5E[Z] - 20 = 5 x 10 - 20 = 30

12 of 53

Linearity of Expectation (LoE)

13 of 53

Linearity of Expectation (Proof)

14 of 53

Linearity of Expectation (Proof)

15 of 53

Linearity of Expectation (Proof)

16 of 53

Linearity of Expectation (Proof)

17 of 53

Linearity of Expectation (Proof)

18 of 53

Frogger!

19 of 53

Frogger!

-3 -2 -1 0 +1 +2 +3

20 of 53

Frogger!

Brute Force

-3 -2 -1 0 +1 +2 +3

21 of 53

Frogger!

Brute Force

-3 -2 -1 0 +1 +2 +3

22 of 53

Frogger!

Brute Force

-3 -2 -1 0 +1 +2 +3

23 of 53

Frogger!

Brute Force

-3 -2 -1 0 +1 +2 +3

24 of 53

Frogger!

Brute Force

-3 -2 -1 0 +1 +2 +3

25 of 53

Frogger!

Brute Force

-3 -2 -1 0 +1 +2 +3

26 of 53

Frogger!

Brute Force

-3 -2 -1 0 +1 +2 +3

27 of 53

Frogger!

Brute Force

-3 -2 -1 0 +1 +2 +3

28 of 53

Frogger!

Brute Force

-3 -2 -1 0 +1 +2 +3

29 of 53

Random Picture

30 of 53

Frogger!

Linearity

-3 -2 -1 0 +1 +2 +3

31 of 53

Frogger!

Linearity

-3 -2 -1 0 +1 +2 +3

32 of 53

Frogger!

Linearity

-3 -2 -1 0 +1 +2 +3

33 of 53

Frogger!

Linearity

-3 -2 -1 0 +1 +2 +3

34 of 53

Frogger!

Linearity

-3 -2 -1 0 +1 +2 +3

35 of 53

Frogger!

Linearity

-3 -2 -1 0 +1 +2 +3

36 of 53

Frogger!

Linearity

-3 -2 -1 0 +1 +2 +3

37 of 53

Frogger!

Which method was Easier?

38 of 53

Frogger!

Which method was Easier?

IN this case, it might be debatable.

39 of 53

Frogger!

Which method was Easier?

IN this case, it might be debatable.

But what if we changed the number of time steps to 100 or 1000?

40 of 53

Frogger!

Which method was Easier?

IN this case, it might be debatable.

But what if we changed the number of time steps to 100 or 1000?

the first method would be completely infeasible, but the second (LoE) would be basically the same.

41 of 53

Flipping 2 coins again

42 of 53

Flipping 2 coins again

43 of 53

Flipping 2 coins again

44 of 53

Flipping 2 coins again

45 of 53

Flipping 2 coins again

46 of 53

Flipping 2 coins again

47 of 53

Flipping 2 coins again

48 of 53

Flipping 2 coins again

49 of 53

Flipping 2 coins again

50 of 53

Flipping 2 coins again

51 of 53

Flipping 2 coins again

52 of 53

Law of the Unconscious Statistician (Lotus)

53 of 53

Probability

Alex Tsun

Joshua Fan