csc/mata67 fall 2021

74
CSC/MATA67 Fall 2021 Week 5 - Expectation and Pigeon Hole Principle Anna Bretscher October 5, 2021 1 / 22

Upload: others

Post on 27-Mar-2022

1 views

Category:

Documents


0 download

TRANSCRIPT

CSC/MATA67 Fall 2021Week 5 - Expectation and Pigeon Hole Principle

Anna Bretscher

October 5, 2021

1 / 22

This Week

I Practice - Bayes Theorem

I Expectation

I Pigeon Hole Principle (PHP)

2 / 22

Bayes’ Theorem ExampleExample. Given two bags.

I One bag contains 12 blue balls and 7 white balls.

I The second bag contains 8 blue balls and 19 white balls.

We pick a bag at random and a ball is chosen from the bag.

Q. What is the probability that the chosen ball is blue?

On the board...

3 / 22

Generalized Total ProbabilityThere is a generalized version of Bayes’ Theorem derived from:

Theorem (Generalized Total Probability). Let a sample space S be adisjoint union of events B1,B2, . . . ,Bn with positive probabilities, and letA ⊆ S. Then:

P(A) =n∑

i=1

P(A|Bi) · P(Bi)

Imagine we partition the sample space into B1,B2, . . .Bn:

4 / 22

Bayes’ TheoremGeneralized Version: Partition the sample space into B1, . . . ,Bn.

Then

P(A) =n∑

i=1

Pr(A | Bi) Pr(Bi)

Pr(Bk | A) =

Pr(A | Bk) Pr(Bk)P(A)

=

Pr(A | Bk) Pr(Bk)∑ni=1 Pr(A | Bi) Pr(Bi)

5 / 22

Bayes’ TheoremGeneralized Version: Partition the sample space into B1, . . . ,Bn.

Then

P(A) =n∑

i=1

Pr(A | Bi) Pr(Bi)

Pr(Bk | A) =

Pr(A | Bk) Pr(Bk)P(A)

=

Pr(A | Bk) Pr(Bk)∑ni=1 Pr(A | Bi) Pr(Bi)

5 / 22

Bayes’ TheoremGeneralized Version: Partition the sample space into B1, . . . ,Bn.

Then

P(A) =n∑

i=1

Pr(A | Bi) Pr(Bi)

Pr(Bk | A) =Pr(A | Bk) Pr(Bk)

P(A)

=

Pr(A | Bk) Pr(Bk)∑ni=1 Pr(A | Bi) Pr(Bi)

5 / 22

Bayes’ TheoremGeneralized Version: Partition the sample space into B1, . . . ,Bn.

Then

P(A) =n∑

i=1

Pr(A | Bi) Pr(Bi)

Pr(Bk | A) =Pr(A | Bk) Pr(Bk)

P(A)

=Pr(A | Bk) Pr(Bk)∑ni=1 Pr(A | Bi) Pr(Bi)

5 / 22

Conditional Probability and Independence

Definition. A, B are independent iff Pr(A | B) = Pr(A).

Q. If A, B are independent, then what do we know about P(A ∩ B)?

A.

P(A ∩ B) = P(B) · P(A|B) and P(A ∩ B) == P(B) · P(A).

Take Home. For independent events A an B, P(A ∩ B) = P(B) · P(A).

Definition. If A ∩ B = ∅ then A and B are mutually exclusive and

P(A ∪ B) = P(A) + P(B).

6 / 22

Conditional Probability and Independence

Definition. A, B are independent iff Pr(A | B) = Pr(A).

Q. If A, B are independent, then what do we know about P(A ∩ B)?

A. P(A ∩ B) = P(B) · P(A|B) and P(A ∩ B) == P(B) · P(A).

Take Home. For independent events A an B, P(A ∩ B) = P(B) · P(A).

Definition. If A ∩ B = ∅ then A and B are mutually exclusive and

P(A ∪ B) = P(A) + P(B).

6 / 22

Conditional Probability and Independence

Definition. A, B are independent iff Pr(A | B) = Pr(A).

Q. If A, B are independent, then what do we know about P(A ∩ B)?

A. P(A ∩ B) = P(B) · P(A|B) and P(A ∩ B) == P(B) · P(A).

Take Home. For independent events A an B, P(A ∩ B) = P(B) · P(A).

Definition. If A ∩ B = ∅ then A and B are mutually exclusive and

P(A ∪ B) =

P(A) + P(B).

6 / 22

Conditional Probability and Independence

Definition. A, B are independent iff Pr(A | B) = Pr(A).

Q. If A, B are independent, then what do we know about P(A ∩ B)?

A. P(A ∩ B) = P(B) · P(A|B) and P(A ∩ B) == P(B) · P(A).

Take Home. For independent events A an B, P(A ∩ B) = P(B) · P(A).

Definition. If A ∩ B = ∅ then A and B are mutually exclusive and

P(A ∪ B) = P(A) + P(B).

6 / 22

Expectation

A roulette wheel has 37 pockets. A ball falls into oneof them with equal probability.

I You bet on which pocket the ball falls into.

I If you guess wrong: casino earns $1 with probability?

3637 .

I If you guess right: casino loses $35 with probability? 137 .

I What is the average (expected) casino earning?

Let X (a random variable) represent the casino’s earnings.

Let E(X) be the expected value of X.

Q. Do you expect E(X) to be large or small?

7 / 22

Expectation

A roulette wheel has 37 pockets. A ball falls into oneof them with equal probability.

I You bet on which pocket the ball falls into.

I If you guess wrong: casino earns $1 with probability?

3637 .

I If you guess right: casino loses $35 with probability? 137 .

I What is the average (expected) casino earning?

Let X (a random variable) represent the casino’s earnings.

Let E(X) be the expected value of X.

Q. Do you expect E(X) to be large or small?

7 / 22

Expectation

A roulette wheel has 37 pockets. A ball falls into oneof them with equal probability.

I You bet on which pocket the ball falls into.

I If you guess wrong: casino earns $1 with probability?

3637 .

I If you guess right: casino loses $35 with probability? 137 .

I What is the average (expected) casino earning?

Let X (a random variable) represent the casino’s earnings.

Let E(X) be the expected value of X.

Q. Do you expect E(X) to be large or small?

7 / 22

Expectation

A roulette wheel has 37 pockets. A ball falls into oneof them with equal probability.

I You bet on which pocket the ball falls into.

I If you guess wrong: casino earns $1 with probability? 3637 .

I If you guess right: casino loses $35 with probability?

137 .

I What is the average (expected) casino earning?

Let X (a random variable) represent the casino’s earnings.

Let E(X) be the expected value of X.

Q. Do you expect E(X) to be large or small?

7 / 22

Expectation

A roulette wheel has 37 pockets. A ball falls into oneof them with equal probability.

I You bet on which pocket the ball falls into.

I If you guess wrong: casino earns $1 with probability? 3637 .

I If you guess right: casino loses $35 with probability?

137 .

I What is the average (expected) casino earning?

Let X (a random variable) represent the casino’s earnings.

Let E(X) be the expected value of X.

Q. Do you expect E(X) to be large or small?

7 / 22

Expectation

A roulette wheel has 37 pockets. A ball falls into oneof them with equal probability.

I You bet on which pocket the ball falls into.

I If you guess wrong: casino earns $1 with probability? 3637 .

I If you guess right: casino loses $35 with probability? 137 .

I What is the average (expected) casino earning?

Let X (a random variable) represent the casino’s earnings.

Let E(X) be the expected value of X.

Q. Do you expect E(X) to be large or small?

7 / 22

Expectation

A roulette wheel has 37 pockets. A ball falls into oneof them with equal probability.

I You bet on which pocket the ball falls into.

I If you guess wrong: casino earns $1 with probability? 3637 .

I If you guess right: casino loses $35 with probability? 137 .

I What is the average (expected) casino earning?

Let X (a random variable) represent the casino’s earnings.

Let E(X) be the expected value of X.

Q. Do you expect E(X) to be large or small?

7 / 22

Expectation

A roulette wheel has 37 pockets. A ball falls into oneof them with equal probability.

I You bet on which pocket the ball falls into.

I If you guess wrong: casino earns $1 with probability? 3637 .

I If you guess right: casino loses $35 with probability? 137 .

I What is the average (expected) casino earning?

Let X (a random variable) represent the casino’s earnings.

Let E(X) be the expected value of X.

Q. Do you expect E(X) to be large or small?

7 / 22

Expected Casino Earnings

I You bet on which pocket the ball falls into.

I If you guess wrong: casino earns $1 with probability 3637 .

I If you guess right: casino loses $35 with probability 137 .

Let E(X) be the expected value of X, the casino earnings.

E(X) =

1 Pr(X = 1) + (−35) Pr(X = −35)

=

1 · 36/37 − 35 · 1/37

=

1/37 = 0.027 . . .

Small earnings each time but over millions of spins...

8 / 22

Expected Casino Earnings

I You bet on which pocket the ball falls into.

I If you guess wrong: casino earns $1 with probability 3637 .

I If you guess right: casino loses $35 with probability 137 .

Let E(X) be the expected value of X, the casino earnings.

E(X) =

1 Pr(X = 1) + (−35) Pr(X = −35)

=

1 · 36/37 − 35 · 1/37

=

1/37 = 0.027 . . .

Small earnings each time but over millions of spins...

8 / 22

Expected Casino Earnings

I You bet on which pocket the ball falls into.

I If you guess wrong: casino earns $1 with probability 3637 .

I If you guess right: casino loses $35 with probability 137 .

Let E(X) be the expected value of X, the casino earnings.

E(X) = 1 Pr(X = 1) + (−35) Pr(X = −35)=

1 · 36/37 − 35 · 1/37

=

1/37 = 0.027 . . .

Small earnings each time but over millions of spins...

8 / 22

Expected Casino Earnings

I You bet on which pocket the ball falls into.

I If you guess wrong: casino earns $1 with probability 3637 .

I If you guess right: casino loses $35 with probability 137 .

Let E(X) be the expected value of X, the casino earnings.

E(X) = 1 Pr(X = 1) + (−35) Pr(X = −35)= 1 · 36/37 − 35 · 1/37= 1/37 = 0.027 . . .

Small earnings each time but over millions of spins...

8 / 22

Expectation - DefinitionThe expected value of an experiment is the weighted average of theoutcomes based on the likelihood that the outcome may occur.

Expected Value. We calculate the expected value of an experiment byconsidering:

I all possible outcomes ai, 0 ≤ i ≤ n and

I their corresponding probabilities pi, 0 ≤ i ≤ n

Expected Value =n∑

i=1

aipi = a1p1 + a2p2 + · · · + anpn

9 / 22

Expectation - DefinitionThe expected value of an experiment is the weighted average of theoutcomes based on the likelihood that the outcome may occur.

Expected Value. We calculate the expected value of an experiment byconsidering:

I all possible outcomes ai, 0 ≤ i ≤ n and

I their corresponding probabilities pi, 0 ≤ i ≤ n

Expected Value =n∑

i=1

aipi = a1p1 + a2p2 + · · · + anpn

9 / 22

Pigeon Hole Principle

Pigeon Hole Principle.

If n items are put into m containers, with n > m,then at least one container must contain morethan one item.

Example. Ten points are placed within a unit (this means the side lengthis 1) equilateral (all three sides have the same length) triangle.

Show that there exist two points with distance at most 13 apart.

Notice that each inner triangle has side length 13 . Since there are 9 of

them by pigeon there must be one with two points in it and those pointscan be at most distance 1

3 .

10 / 22

Pigeon Hole Principle

Pigeon Hole Principle.

If n items are put into m containers, with n > m,then at least one container must contain morethan one item.

Example. Ten points are placed within a unit (this means the side lengthis 1) equilateral (all three sides have the same length) triangle.

Show that there exist two points with distance at most 13 apart.

Notice that each inner triangle has side length 13 . Since there are 9 of

them by pigeon there must be one with two points in it and those pointscan be at most distance 1

3 .

10 / 22

Socks!Example. Charlie has a drawer full of 12 red and 14 blue socks.

⇒ In order to avoid waking his roommate, he must grab a selection ofclothes in the dark and get dressed in the hallway.

Q. How many socks must he grab to be assured of having a matchingpair?

Solution.

Pigeons:

socks

Holes: colours

He needs 3 socks.

11 / 22

Socks!Example. Charlie has a drawer full of 12 red and 14 blue socks.

⇒ In order to avoid waking his roommate, he must grab a selection ofclothes in the dark and get dressed in the hallway.

Q. How many socks must he grab to be assured of having a matchingpair?

Solution.

Pigeons:

socks

Holes: colours

He needs 3 socks.

11 / 22

Socks!Example. Charlie has a drawer full of 12 red and 14 blue socks.

⇒ In order to avoid waking his roommate, he must grab a selection ofclothes in the dark and get dressed in the hallway.

Q. How many socks must he grab to be assured of having a matchingpair?

Solution.

Pigeons:

socks

Holes:

colours

He needs 3 socks.

11 / 22

Socks!Example. Charlie has a drawer full of 12 red and 14 blue socks.

⇒ In order to avoid waking his roommate, he must grab a selection ofclothes in the dark and get dressed in the hallway.

Q. How many socks must he grab to be assured of having a matchingpair?

Solution.

Pigeons: socks

Holes:

colours

He needs 3 socks.

11 / 22

Socks!Example. Charlie has a drawer full of 12 red and 14 blue socks.

⇒ In order to avoid waking his roommate, he must grab a selection ofclothes in the dark and get dressed in the hallway.

Q. How many socks must he grab to be assured of having a matchingpair?

Solution.

Pigeons: socks

Holes: colours

He needs 3 socks.

11 / 22

Socks!Example. Charlie has a drawer full of 12 red and 14 blue socks.

⇒ In order to avoid waking his roommate, he must grab a selection ofclothes in the dark and get dressed in the hallway.

Q. How many socks must he grab to be assured of having a matchingpair?

Solution.

Pigeons: socks

Holes: colours

He needs 3 socks.

11 / 22

It’s Like MagicExample.

Show that given a set of n positive integers, there exists a non-emptysubset whose sum is divisible by n.

Proof done together in class:

Let the n integers be denoted by a1, a2, . . . , an. Form the n sums:

S1 = a1

S2 = a1 + a2

...

Sn = a1 + a2 + . . . + an

12 / 22

It’s Like MagicExample.

Show that given a set of n positive integers, there exists a non-emptysubset whose sum is divisible by n.

Proof done together in class:

Let the n integers be denoted by a1, a2, . . . , an. Form the n sums:

S1 = a1

S2 = a1 + a2

...

Sn = a1 + a2 + . . . + an

12 / 22

It’s Like MagicExample.

Show that given a set of n positive integers, there exists a non-emptysubset whose sum is divisible by n.

Proof done together in class:

Let the n integers be denoted by a1, a2, . . . , an. Form the n sums:

S1 = a1

S2 = a1 + a2

...

Sn = a1 + a2 + . . . + an

If one of these sums is divisible by n, then we are done.

12 / 22

It’s Like MagicExample.

Show that given a set of n positive integers, there exists a non-emptysubset whose sum is divisible by n.

Proof done together in class:

Let the n integers be denoted by a1, a2, . . . , an. Form the n sums:

S1 = a1

S2 = a1 + a2

...

Sn = a1 + a2 + . . . + an

Otherwise, by the pigeon hole principle (PHP), at least two of the sumsmust have the same remainder when divided by n (since only n − 1distinct remainders are possible).

12 / 22

It’s Like MagicRemember the original claim:

Show that given a set of n positive integers, there exists a non-empty subset whose sum is divisible by n.

By the pigeon hole principle (PHP):

I At least two of the sums must have the same remainder whendivided by n (since only n − 1 distinct remainders are possible).

I Pick two sums Si and Sj, with j > i, that have the same remainderwhen divided by n.

I So, Si = n · q1 + r and Sj = n · q2 + r.

I Then Sj − Si = n · q2 + r − (n · q1 + r) = n(q2 − q1)

I What is n(q2 − q1) in terms of the elements in S?

I n(q2 − q1) = ai+1 + · · · + aj

13 / 22

It’s Like MagicRemember the original claim:

Show that given a set of n positive integers, there exists a non-empty subset whose sum is divisible by n.

By the pigeon hole principle (PHP):

I At least two of the sums must have the same remainder whendivided by n (since only n − 1 distinct remainders are possible).

I Pick two sums Si and Sj, with j > i, that have the same remainderwhen divided by n.

I So, Si = n · q1 + r and Sj = n · q2 + r.

I Then Sj − Si = n · q2 + r − (n · q1 + r) = n(q2 − q1)

I What is n(q2 − q1) in terms of the elements in S?

I n(q2 − q1) = ai+1 + · · · + aj

13 / 22

It’s Like MagicRemember the original claim:

Show that given a set of n positive integers, there exists a non-empty subset whose sum is divisible by n.

By the pigeon hole principle (PHP):

I At least two of the sums must have the same remainder whendivided by n (since only n − 1 distinct remainders are possible).

I Pick two sums Si and Sj, with j > i, that have the same remainderwhen divided by n.

I So, Si = n · q1 + r and Sj = n · q2 + r.

I Then Sj − Si = n · q2 + r − (n · q1 + r) = n(q2 − q1)

I What is n(q2 − q1) in terms of the elements in S?

I n(q2 − q1) = ai+1 + · · · + aj

13 / 22

It’s Like MagicRemember the original claim:

Show that given a set of n positive integers, there exists a non-empty subset whose sum is divisible by n.

By the pigeon hole principle (PHP):

I At least two of the sums must have the same remainder whendivided by n (since only n − 1 distinct remainders are possible).

I Pick two sums Si and Sj, with j > i, that have the same remainderwhen divided by n.

I So, Si = n · q1 + r and Sj = n · q2 + r.

I Then Sj − Si = n · q2 + r − (n · q1 + r) = n(q2 − q1)

I What is n(q2 − q1) in terms of the elements in S?

I n(q2 − q1) = ai+1 + · · · + aj

13 / 22

It’s Like MagicRemember the original claim:

Show that given a set of n positive integers, there exists a non-empty subset whose sum is divisible by n.

By the pigeon hole principle (PHP):

I At least two of the sums must have the same remainder whendivided by n (since only n − 1 distinct remainders are possible).

I Pick two sums Si and Sj, with j > i, that have the same remainderwhen divided by n.

I So, Si = n · q1 + r and Sj = n · q2 + r.

I Then Sj − Si = n · q2 + r − (n · q1 + r) = n(q2 − q1)

I What is n(q2 − q1) in terms of the elements in S?

I n(q2 − q1) = ai+1 + · · · + aj

13 / 22

It’s Like MagicRemember the original claim:

Show that given a set of n positive integers, there exists a non-empty subset whose sum is divisible by n.

By the pigeon hole principle (PHP):

I At least two of the sums must have the same remainder whendivided by n (since only n − 1 distinct remainders are possible).

I Pick two sums Si and Sj, with j > i, that have the same remainderwhen divided by n.

I So, Si = n · q1 + r and Sj = n · q2 + r.

I Then Sj − Si = n · q2 + r − (n · q1 + r) = n(q2 − q1)

I What is n(q2 − q1) in terms of the elements in S?

I n(q2 − q1) = ai+1 + · · · + aj

13 / 22

TournamentsExample. In a round-robin tournament of n players, every player playsevery other player exactly once. Prove that if no player goes undefeated,at the end of the tournament there must be two players with the samenumber of wins.

Solutions.

If there are n players then each player plays n − 1 games. If they playn − 1 games and no player wins them all then the most a player can winis n − 2 games.

Pigeons: n players

Holes: The number of wins a player has, which ranges from 0 to n − 2 son − 1 holes.

Therefore, two players must have the same number of wins.

Food for thought. Would this argument work if a player is allowed to goundefeated?

14 / 22

TournamentsExample. In a round-robin tournament of n players, every player playsevery other player exactly once. Prove that if no player goes undefeated,at the end of the tournament there must be two players with the samenumber of wins.

Solutions.

If there are n players then each player plays n − 1 games. If they playn − 1 games and no player wins them all then the most a player can winis n − 2 games.

Pigeons:

n players

Holes: The number of wins a player has, which ranges from 0 to n − 2 son − 1 holes.

Therefore, two players must have the same number of wins.

Food for thought. Would this argument work if a player is allowed to goundefeated?

14 / 22

TournamentsExample. In a round-robin tournament of n players, every player playsevery other player exactly once. Prove that if no player goes undefeated,at the end of the tournament there must be two players with the samenumber of wins.

Solutions.

If there are n players then each player plays n − 1 games. If they playn − 1 games and no player wins them all then the most a player can winis n − 2 games.

Pigeons: n players

Holes:

The number of wins a player has, which ranges from 0 to n − 2 son − 1 holes.

Therefore, two players must have the same number of wins.

Food for thought. Would this argument work if a player is allowed to goundefeated?

14 / 22

TournamentsExample. In a round-robin tournament of n players, every player playsevery other player exactly once. Prove that if no player goes undefeated,at the end of the tournament there must be two players with the samenumber of wins.

Solutions.

If there are n players then each player plays n − 1 games. If they playn − 1 games and no player wins them all then the most a player can winis n − 2 games.

Pigeons: n players

Holes: The number of wins a player has, which ranges from 0 to n − 2 son − 1 holes.

Therefore, two players must have the same number of wins.

Food for thought. Would this argument work if a player is allowed to goundefeated?

14 / 22

TournamentsExample. In a round-robin tournament of n players, every player playsevery other player exactly once. Prove that if no player goes undefeated,at the end of the tournament there must be two players with the samenumber of wins.

Solutions.

If there are n players then each player plays n − 1 games. If they playn − 1 games and no player wins them all then the most a player can winis n − 2 games.

Pigeons: n players

Holes: The number of wins a player has, which ranges from 0 to n − 2 son − 1 holes.

Therefore, two players must have the same number of wins.

Food for thought. Would this argument work if a player is allowed to goundefeated?

14 / 22

SumsExample. Given any 7 different integers, prove that there must exist apair whose sum or difference is a multiple of 10.

HINT: Look at the 1s digit...

Solution.

Try playing around with numbers...notice anything?

Lets consider how we can sum numbers so that they are multiples of 10.

Q. Which combinations of 1’s digits sum or subtract to 0 (ie the number isa multiple of 10):

(0) ⇒ 0 + / − 0

(1, 9, -1, -9) ⇒ 1 + 9, 1 − 1, 9 − 9,−1 − 9

(2, 8, -2, -8) ⇒ 2 + 8, 2 − 2, 8 − 8,−2 − 8

(3, 7, -3, -7) ⇒ 3 + 7, 3 − 3, 7 − 7,−3 − 7

(4, 6, -4, -6) ⇒ 4 + 6, 4 − 4, 6 − 6,−4 − 6

(5, -5) ⇒ 5 + 5,−5 − 5

15 / 22

SumsExample. Given any 7 different integers, prove that there must exist apair whose sum or difference is a multiple of 10.

HINT: Look at the 1s digit...

Solution.

Try playing around with numbers...notice anything?

Lets consider how we can sum numbers so that they are multiples of 10.

Q. Which combinations of 1’s digits sum or subtract to 0 (ie the number isa multiple of 10):

(0) ⇒ 0 + / − 0

(1, 9, -1, -9) ⇒ 1 + 9, 1 − 1, 9 − 9,−1 − 9

(2, 8, -2, -8) ⇒ 2 + 8, 2 − 2, 8 − 8,−2 − 8

(3, 7, -3, -7) ⇒ 3 + 7, 3 − 3, 7 − 7,−3 − 7

(4, 6, -4, -6) ⇒ 4 + 6, 4 − 4, 6 − 6,−4 − 6

(5, -5) ⇒ 5 + 5,−5 − 5

15 / 22

SumsExample. Given any 7 different integers, prove that there must exist apair whose sum or difference is a multiple of 10.

HINT: Look at the 1s digit...

Solution.

Try playing around with numbers...notice anything?

Lets consider how we can sum numbers so that they are multiples of 10.

Q. Which combinations of 1’s digits sum or subtract to 0 (ie the number isa multiple of 10):

(0) ⇒ 0 + / − 0

(1, 9, -1, -9) ⇒ 1 + 9, 1 − 1, 9 − 9,−1 − 9

(2, 8, -2, -8) ⇒ 2 + 8, 2 − 2, 8 − 8,−2 − 8

(3, 7, -3, -7) ⇒ 3 + 7, 3 − 3, 7 − 7,−3 − 7

(4, 6, -4, -6) ⇒ 4 + 6, 4 − 4, 6 − 6,−4 − 6

(5, -5) ⇒ 5 + 5,−5 − 515 / 22

Multiples of 10

(0) ⇒ 0 + / − 0

(1, 9, -1, -9) ⇒ 1 + 9, 1 − 1, 9 − 9,−1 − 9

(2, 8, -2, -8) ⇒ 2 + 8, 2 − 2, 8 − 8,−2 − 8

(3, 7, -3, -7) ⇒ 3 + 7, 3 − 3, 7 − 7,−3 − 7

(4, 6, -4, -6) ⇒ 4 + 6, 4 − 4, 6 − 6,−4 − 6

(5, -5) ⇒ 5 + 5,−5 − 5

Q. How many categories are there?

A.

6. What are the pigeons?

A. The 7 numbers.

16 / 22

Multiples of 10

(0) ⇒ 0 + / − 0

(1, 9, -1, -9) ⇒ 1 + 9, 1 − 1, 9 − 9,−1 − 9

(2, 8, -2, -8) ⇒ 2 + 8, 2 − 2, 8 − 8,−2 − 8

(3, 7, -3, -7) ⇒ 3 + 7, 3 − 3, 7 − 7,−3 − 7

(4, 6, -4, -6) ⇒ 4 + 6, 4 − 4, 6 − 6,−4 − 6

(5, -5) ⇒ 5 + 5,−5 − 5

Q. How many categories are there?

A. 6. What are the pigeons?

A.

The 7 numbers.

16 / 22

Multiples of 10

(0) ⇒ 0 + / − 0

(1, 9, -1, -9) ⇒ 1 + 9, 1 − 1, 9 − 9,−1 − 9

(2, 8, -2, -8) ⇒ 2 + 8, 2 − 2, 8 − 8,−2 − 8

(3, 7, -3, -7) ⇒ 3 + 7, 3 − 3, 7 − 7,−3 − 7

(4, 6, -4, -6) ⇒ 4 + 6, 4 − 4, 6 − 6,−4 − 6

(5, -5) ⇒ 5 + 5,−5 − 5

Q. How many categories are there?

A. 6. What are the pigeons?

A. The 7 numbers.

16 / 22

Birthdays AgainExample. Explain why in a class of 36 students, at least 6 were born onthe same day of the week.

Solution.

Make each day of the week a container, then there are 7. That meansthat by the generalized PHP there are at least 6 in one of the 7 boxes(7 × 5 = 35 < 36).

This problem illustrates the Generalized Pigeon Hole Principle.

Generalized Pigeon Hole Principle.

If n items are put into m containers, with n > m(r − 1), thenat least one container must contain at least r items.

Q. In the previous example then, what are n and m?

A. We had n = 36, m = 7 and since n = 36 > m(r − 1) = 7(6 − 1) = 35 sor = 6.

17 / 22

Birthdays AgainExample. Explain why in a class of 36 students, at least 6 were born onthe same day of the week.

Solution.

Make each day of the week a container, then there are 7. That meansthat by the generalized PHP there are at least 6 in one of the 7 boxes(7 × 5 = 35 < 36).

This problem illustrates the Generalized Pigeon Hole Principle.

Generalized Pigeon Hole Principle.

If n items are put into m containers, with n > m(r − 1), thenat least one container must contain at least r items.

Q. In the previous example then, what are n and m?

A. We had n = 36, m = 7 and since n = 36 > m(r − 1) = 7(6 − 1) = 35 sor = 6.

17 / 22

Birthdays AgainExample. Explain why in a class of 36 students, at least 6 were born onthe same day of the week.

Solution.

Make each day of the week a container, then there are 7. That meansthat by the generalized PHP there are at least 6 in one of the 7 boxes(7 × 5 = 35 < 36).

This problem illustrates the Generalized Pigeon Hole Principle.

Generalized Pigeon Hole Principle.

If n items are put into m containers, with n > m(r − 1), thenat least one container must contain at least r items.

Q. In the previous example then, what are n and m?

A.

We had n = 36, m = 7 and since n = 36 > m(r − 1) = 7(6 − 1) = 35 sor = 6.

17 / 22

Birthdays AgainExample. Explain why in a class of 36 students, at least 6 were born onthe same day of the week.

Solution.

Make each day of the week a container, then there are 7. That meansthat by the generalized PHP there are at least 6 in one of the 7 boxes(7 × 5 = 35 < 36).

This problem illustrates the Generalized Pigeon Hole Principle.

Generalized Pigeon Hole Principle.

If n items are put into m containers, with n > m(r − 1), thenat least one container must contain at least r items.

Q. In the previous example then, what are n and m?

A. We had n = 36, m = 7 and since n = 36 > m(r − 1) = 7(6 − 1) = 35 sor = 6.

17 / 22

Website Image RepetitionExample. A website displays an image each day from an image bank of30 images. In any given 100-day period, show that some image must bedisplayed four times.

Solution.

Holes:

The 30 images

Pigeons: the 100 days.

Then notice that30(4 − 1) = 30(3) = 90 < n

so by the GPHP there are at least 4 days with the same image.

18 / 22

Website Image RepetitionExample. A website displays an image each day from an image bank of30 images. In any given 100-day period, show that some image must bedisplayed four times.

Solution.

Holes: The 30 images

Pigeons:

the 100 days.

Then notice that30(4 − 1) = 30(3) = 90 < n

so by the GPHP there are at least 4 days with the same image.

18 / 22

Website Image RepetitionExample. A website displays an image each day from an image bank of30 images. In any given 100-day period, show that some image must bedisplayed four times.

Solution.

Holes: The 30 images

Pigeons: the 100 days.

Then notice that30(4 − 1) = 30(3) = 90 < n

so by the GPHP there are at least 4 days with the same image.

18 / 22

Website Image RepetitionExample. A website displays an image each day from an image bank of30 images. In any given 100-day period, show that some image must bedisplayed four times.

Solution.

Holes: The 30 images

Pigeons: the 100 days.

Then notice that30(4 − 1) = 30(3) = 90 < n

so by the GPHP there are at least 4 days with the same image.

18 / 22

Graphs

A Graph G = (V,E) consists of:

I a set V of vertices of size n (think of vertices as objects) and

I a set E of edges of size m joining pairs of vertices.

Example. The graph G with

I V = {1, 2, 3, 4} and

I E = {(1, 2), (1, 4), (2, 3), (2, 4)}

can be drawn as dots tp represent vertices and linesto represent edges.

1

2 3

4

19 / 22

Graph ColouringExample. Let G be a graph with 6 vertices such that every pair ofvertices has an edge between them.

Let V = {a, b, c, d, e, f }| be the vertices. Draw the graph.

1

2

3 4

5

6

Q. How many edges should your graph have?

A.C(6, 2) = 15

20 / 22

Graph ColouringExample. Let G be a graph with 6 vertices such that every pair ofvertices has an edge between them.

Let V = {a, b, c, d, e, f }| be the vertices. Draw the graph.

1

2

3 4

5

6

Q. How many edges should your graph have?

A.

C(6, 2) = 15

20 / 22

Graph ColouringExample. Let G be a graph with 6 vertices such that every pair ofvertices has an edge between them.

Let V = {a, b, c, d, e, f }| be the vertices. Draw the graph.

1

2

3 4

5

6

Q. How many edges should your graph have?

A.C(6, 2) = 15

20 / 22

Triangle!Q. Suppose that some edges are coloured red and the rest blue. Showthat there must be some triangle (three edges forming a triangle) of thesame colour.

A.

1

2

3 4

5

6

I Pick any vertex, e.g., 1.

I There are 5 edges, so by PHP, three or more of the edges have tohave the same colour.

I Suppose that colour is red and that the three (or more vertices) arevertex numbers 4, 5, 6.

I Consider these three vertices, if they form an all blue triangle thenwe are done.

I If not, then one of their edges is red and so that edge along withvertex 1 forms a red triangle.

21 / 22

Triangle!Q. Suppose that some edges are coloured red and the rest blue. Showthat there must be some triangle (three edges forming a triangle) of thesame colour.

A. 1

2

3 4

5

6

I Pick any vertex, e.g., 1.

I There are 5 edges, so by PHP, three or more of the edges have tohave the same colour.

I Suppose that colour is red and that the three (or more vertices) arevertex numbers 4, 5, 6.

I Consider these three vertices, if they form an all blue triangle thenwe are done.

I If not, then one of their edges is red and so that edge along withvertex 1 forms a red triangle.

21 / 22

Triangle!Q. Suppose that some edges are coloured red and the rest blue. Showthat there must be some triangle (three edges forming a triangle) of thesame colour.

A. 1

2

3 4

5

6

I Pick any vertex, e.g., 1.

I There are 5 edges, so by PHP, three or more of the edges have tohave the same colour.

I Suppose that colour is red and that the three (or more vertices) arevertex numbers 4, 5, 6.

I Consider these three vertices, if they form an all blue triangle thenwe are done.

I If not, then one of their edges is red and so that edge along withvertex 1 forms a red triangle.

21 / 22

Triangle!Q. Suppose that some edges are coloured red and the rest blue. Showthat there must be some triangle (three edges forming a triangle) of thesame colour.

A. 1

2

3 4

5

6

I Pick any vertex, e.g., 1.

I There are 5 edges, so by PHP, three or more of the edges have tohave the same colour.

I Suppose that colour is red and that the three (or more vertices) arevertex numbers 4, 5, 6.

I Consider these three vertices, if they form an all blue triangle thenwe are done.

I If not, then one of their edges is red and so that edge along withvertex 1 forms a red triangle.

21 / 22

Triangle!Q. Suppose that some edges are coloured red and the rest blue. Showthat there must be some triangle (three edges forming a triangle) of thesame colour.

A. 1

2

3 4

5

6

I Pick any vertex, e.g., 1.

I There are 5 edges, so by PHP, three or more of the edges have tohave the same colour.

I Suppose that colour is red and that the three (or more vertices) arevertex numbers 4, 5, 6.

I Consider these three vertices, if they form an all blue triangle thenwe are done.

I If not, then one of their edges is red and so that edge along withvertex 1 forms a red triangle.

21 / 22

Triangle!Q. Suppose that some edges are coloured red and the rest blue. Showthat there must be some triangle (three edges forming a triangle) of thesame colour.

A. 1

2

3 4

5

6

I Pick any vertex, e.g., 1.

I There are 5 edges, so by PHP, three or more of the edges have tohave the same colour.

I Suppose that colour is red and that the three (or more vertices) arevertex numbers 4, 5, 6.

I Consider these three vertices, if they form an all blue triangle thenwe are done.

I If not, then one of their edges is red and so that edge along withvertex 1 forms a red triangle.

21 / 22

HAPPY READING WEEK

22 / 22