0% found this document useful (0 votes)
13 views62 pages

Lecture18 Annotated

The document covers principles of counting, including types of selections, Pascal's Triangle, and the Inclusion-Exclusion and Pigeonhole Principles. It provides examples of counting selections with and without repetition and explores problems involving combinations of colored marbles and grid paths. The lecture emphasizes understanding the types of selections and their corresponding formulas.

Uploaded by

Surya Ganesh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views62 pages

Lecture18 Annotated

The document covers principles of counting, including types of selections, Pascal's Triangle, and the Inclusion-Exclusion and Pigeonhole Principles. It provides examples of counting selections with and without repetition and explores problems involving combinations of colored marbles and grid paths. The lecture emphasizes understanding the types of selections and their corresponding formulas.

Uploaded by

Surya Ganesh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 62

Principles of Counting

MAT9004 - Week 9 - Lecture 18


Lecture 18

Four types of selections: more examples

Pascal’s Triangle & Binomial coefficients

Venn diagrams

The Inclusion-Exclusion Principle

The Pigeonhole Principle

2 / 27
Recap: four types of selections
Suppose we draw r times from a hat with n names:
(1) Ordered selections without repetition:
n!
n(n − 1) · · · (n − r + 1) = .
(n − r )!
(2) Unordered selections without repetition:
 
n(n − 1) · · · (n − r + 1) n! n
= = .
r! r !(n − r )! r
(3) Ordered selections with repetition:
r
| ×n×
n {z· · · × n} = n .
r

(4) Unordered selections with repetition:


 
r +n−1 (r + n − 1)!
= .
r r !(n − 1)!
3 / 27
You only need to identify the type of selection and parameters n, r corresponding to
names and draws, respectively.

4 / 27
Poll Everywhere PollEv.com/andreasernst905
In a game, each of 10 players holds red, blue and green marbles, and places one marble
in a bag.
1) How many possibilities are there for the colours of marbles in the bag? Is this
ordered/unordered, with/without repetition?
2) If each player chooses one of the 3 colours with equal likelihood, are all outcomes
for the bag equally likely?
3) If the bag contains 2 red, 3 blue & 5 green marbles and each of the 10 people
take one, what is the formula for the number of possible outcomes?
           
10 8 10 5 10! 10 7
(a ) × (b ) × (c ) (d ) ×
2 3 5 3 2! × 3! × 5! 2+5 2

5 / 27
Questions
Exercise
In a game, each of 10 players holds red, blue and green marbles, and places one
marble in a bag.
(a) How many possibilities are there for the colours of marbles in the bag?
(b) If each player chooses their colour at random are all of these possibilities
equally likely?

A ordered without rep. B unordered without rep.


C ordered with rep. D unordered with rep.

6 / 27
Questions
Exercise
In a game, each of 10 players holds red, blue and green marbles, and places one
marble in a bag.
(a) How many possibilities are there for the colours of marbles in the bag?
(b) If each player chooses their colour at random are all of these possibilities
equally likely?

A ordered without rep. B unordered without rep.


C ordered with rep. D unordered with rep.

ANS (a): There are


    
n + r − 1 3 + 10 − 1 12 12! 12 × 11
= = = 66
r 10 10 10! 2! 2
possibilities.

6 / 27
Questions
Exercise
In a game, each of 10 players holds red, blue and green marbles, and places one
marble in a bag.
(a) How many possibilities are there for the colours of marbles in the bag?
(b) If each player chooses their colour at random are all of these possibilities
equally likely?

A ordered without rep. B unordered without rep.


C ordered with rep. D unordered with rep.

ANS (a): There are


    
n + r − 1 3 + 10 − 1 12 12! 12 × 11
= = = 66
r 10 10 10! 2! 2
possibilities.
ANS (b): They are not equally likely: For example ”all red” case is less likely than 3
red, 3 blue and 4 green.
6 / 27
Taking marbles from the bag
If the bag contains 2 red, 3 blue & 5 green marbles and each of the 10 people take
one, what is the formula for the number of possible outcomes?
a) Choose 2 people to get a red marble and 3 out of the remaining 8 to get blue
10 8
 
2 × 3 = 2, 520

b) First choose 5 people to get a green marble & then 2 out of 5 to get red:
10 5
 
5 × 2 = 2, 520

c) Hand out the 10 marbles in a fixed sequence but permute the order of people
(10!). Adjust for people getting the same colour in different order:
10!
= 2, 520
2! × 3! × 5!
d) Choose 7 people to get either a red or green marble, then pick 2 of these to get a
red marble:
10 7
 
2+5 × 2 = 2, 520
Conclusion: sometimes there are multiple ways to count correctly.
7 / 27
The grid path problem
How many paths exist which extend (walking right or up) from the bottom left corner
to the top right corner through the 4 × 6 grid?

8 / 27
The grid path problem
How many paths exist which extend (walking right or up) from the bottom left corner
to the top right corner through the 4 × 6 grid?

We can encode each path as a sequence of U’s and R’s. For example, the path above
is RRRRUUUURR.

8 / 27
The grid path problem
How many paths exist which extend (walking right or up) from the bottom left corner
to the top right corner through the 4 × 6 grid?

We can encode each path as a sequence of U’s and R’s. For example, the path above
is RRRRUUUURR.
Counting such sequences is a unordered selection without repetition!

8 / 27
The grid path problem
How many paths exist which extend (walking right or up) from the bottom left corner
to the top right corner through the 4 × 6 grid?

We can encode each path as a sequence of U’s and R’s. For example, the path above
is RRRRUUUURR.
Counting such sequences is a unordered selection without repetition! Therefore, the
number of paths is exactly
 
10 10 · 9 · 8 · 7
= = 210.
4 4·3·2·1

8 / 27
Pascal’s triangle

1
1 1
1 2 1
1 3 3 1
1 4 1 6 4
1 5
10 10 5 1
1 6 15 20 15 6 1
1 7 21 35 35 21 7 1
1 8 28 56 70 56 28 8 1
1 9 36 84 126 126 84 36 9 1
1 10 45 120 210 252 210 120 45 10 1
.. .. ..
. . .
The entries on the left and right edges are all 1.
Every “internal” entry is the sum of the two entries above it.

9 / 27
Pascal’s triangle
We can write Pascal’s triangle in terms of binomial coefficients as follows:
0

0 
1 1

0 1 
2 2 2

3
 0 3 1 3 2 3
4
 0 4 1 4 2 4 3 4
5
 0 5 1 5 2 5 3 5 4 5
6
 6 1 6 2 6 3 6 4 6 5 6
0
0 1 2 3 4 5 6
.. .. ..
. . .
n n
 
Note that for any n we have 0 = 1 and n = 1.

10 / 27
Pascal’s triangle
We can write Pascal’s triangle in terms of binomial coefficients as follows:
0

0 
1 1

0 1 
2 2 2

3
 0 3 1 3 2 3
4
 0 4 1 4 2 4 3 4
5
 0 5 1 5 2 5 3 5 4 5
6
 6 1 6 2 6 3 6 4 6 5 6
0
0 1 2 3 4 5 6
.. .. ..
. . .

Note that for any n we have 0 = 1 and nn = 1.


n
 

This can be seen directly from the formula nr = r !(n−r


n!

)! .

10 / 27
Pascal’s triangle
We can write Pascal’s triangle in terms of binomial coefficients as follows:
0

0 
1 1

0 1 
2 2 2

3
 0 3 1 3 2 3
4
 0 4 1 4 2 4 3 4
5
 0 5 1 5 2 5 3 5 4 5
6
 6 1 6 2 6 3 6 4 6 5 6
0
0 1 2 3 4 5 6
.. .. ..
. . .

Note that for any n we have 0 = 1 and nn = 1.


n



This can be seen directly from the formula nr = r !(n−r


n!

)! .

Exercise
n n
 
Explain why 0 = 1 and n = 1 by thinking about what each binomial coefficient
is counting.

10 / 27
We’ve explained the edges, but why do binomial coefficients satisfy the rule that says
that each “internal” entry in the triangle is the sum of the two entries above it? To
see why this is, we’ll begin with an example.

11 / 27
We’ve explained the edges, but why do binomial coefficients satisfy the rule that says
that each “internal” entry in the triangle is the sum of the two entries above it? To
see why this is, we’ll begin with an example.
6 5 5
  
Example: Why is 2 = 2 + 1 ?

11 / 27
We’ve explained the edges, but why do binomial coefficients satisfy the rule that says
that each “internal” entry in the triangle is the sum of the two entries above it? To
see why this is, we’ll begin with an example.
6 5 5
  
Example: Why is 2 = 2 + 1 ?

6

There are 2 combinations of 2 elements of {1, 2, 3, 4, 5, 6}. Every such combination
either
• does not contain a 6,

11 / 27
We’ve explained the edges, but why do binomial coefficients satisfy the rule that says
that each “internal” entry in the triangle is the sum of the two entries above it? To
see why this is, we’ll begin with an example.
6 5 5
  
Example: Why is 2 = 2 + 1 ?

6

There are 2 combinations of 2 elements of {1, 2, 3, 4, 5, 6}. Every such combination
either
5

• does not contain a 6, in which case it is one of the 2 combinations of 2 elements
of {1, 2, 3, 4, 5}; or

11 / 27
We’ve explained the edges, but why do binomial coefficients satisfy the rule that says
that each “internal” entry in the triangle is the sum of the two entries above it? To
see why this is, we’ll begin with an example.
6 5 5
  
Example: Why is 2 = 2 + 1 ?

6

There are 2 combinations of 2 elements of {1, 2, 3, 4, 5, 6}. Every such combination
either
5

• does not contain a 6, in which case it is one of the 2 combinations of 2 elements
of {1, 2, 3, 4, 5}; or
5

• does contain a 6, in which case the rest of the combination is one of the 1
combinations of 1 element of {1, 2, 3, 4, 5}.

11 / 27
We’ve explained the edges, but why do binomial coefficients satisfy the rule that says
that each “internal” entry in the triangle is the sum of the two entries above it? To
see why this is, we’ll begin with an example.
6 5 5
  
Example: Why is 2 = 2 + 1 ?

6

There are 2 combinations of 2 elements of {1, 2, 3, 4, 5, 6}. Every such combination
either
5

• does not contain a 6, in which case it is one of the 2 combinations of 2 elements
of {1, 2, 3, 4, 5}; or
5

• does contain a 6, in which case the rest of the combination is one of the 1
combinations of 1 element of {1, 2, 3, 4, 5}.

6 5 5
  
So 2 = 2 + 1 by the Addition Rule.

11 / 27
We can make a similar argument in general. Let X be a set  of n elements and x is a
n−1
fixed element of X . For any r ∈ {1, . . . , n}, there are r combinations of r elements
of X that do not contain x and there are n−1

r −1 combinations of r elements of X that
do contain x. So:

12 / 27
We can make a similar argument in general. Let X be a set  of n elements and x is a
n−1
fixed element of X . For any r ∈ {1, . . . , n}, there are r combinations of r elements
of X that do not contain x and there are n−1

r −1 combinations of r elements of X that
do contain x. So:

     
n n−1 n−1
= + for 1 ⩽ r ⩽ n.
r r −1 r

12 / 27
We can make a similar argument in general. Let X be a set  of n elements and x is a
n−1
fixed element of X . For any r ∈ {1, . . . , n}, there are r combinations of r elements
of X that do not contain x and there are n−1

r −1 combinations of r elements of X that
do contain x. So:

     
n n−1 n−1
= + for 1 ⩽ r ⩽ n.
r r −1 r

This shows why the entries in Pascal’s triangle are binomial coefficients, since each is
the sum of the two above it.

12 / 27
Patterns

Pascal’s triangle reveals a lot of different patterns about the binomial coefficients.
Perhaps the most obvious is that every row reads the same left-to-right and
right-to-left. It corresponds to the property that choosing r elements from a set of n
elements is equivalent to choosing n − r elements. So:

13 / 27
Patterns

Pascal’s triangle reveals a lot of different patterns about the binomial coefficients.
Perhaps the most obvious is that every row reads the same left-to-right and
right-to-left. It corresponds to the property that choosing r elements from a set of n
elements is equivalent to choosing n − r elements. So:

   
n n
= for 0 ⩽ r ⩽ n.
r n−r

13 / 27
Patterns

Pascal’s triangle reveals a lot of different patterns about the binomial coefficients.
Perhaps the most obvious is that every row reads the same left-to-right and
right-to-left. It corresponds to the property that choosing r elements from a set of n
elements is equivalent to choosing n − r elements. So:

   
n n
= for 0 ⩽ r ⩽ n.
r n−r

This shows that every row reads the same left-to-right and right-to-left.

13 / 27
Origin of the name “binomial coefficient”
(x + y )0 = 1
(x + y )1 = x +y
(x + y )2 = x 2 + 2xy + y 2
(x + y )3 = x + 3x 2 y + 3xy 2 + y 3
3

(x + y )4 = x + 4x 3 y + 6x 2 y 2 + 4xy 3 + y 4
4

(x + y )5 = x +5x 4 y +10x 3 y 2 +10x 2 y 3 +5xy 4 +y 5


5

14 / 27
Origin of the name “binomial coefficient”
(x + y )0 = 1
(x + y )1 = x +y
(x + y )2 = x 2 + 2xy + y 2
(x + y )3 = x + 3x 2 y + 3xy 2 + y 3
3

(x + y )4 = x + 4x 3 y + 6x 2 y 2 + 4xy 3 + y 4
4

(x + y )5 = x +5x 4 y +10x 3 y 2 +10x 2 y 3 +5xy 4 +y 5


5

Notice that the coefficients on the right are exactly the same as the entries in Pascal’s
triangle. Why does this happen? Think about expanding (x + y )3 and finding the
coefficient of xy 2 , for example.

(x + y )(x + y )(x + y ) = xxx + xxy + xyx + xyy


+ yxx + yxy + yyx + yyy
= x + 3x 2 y + 3xy 2 + y 3
3

14 / 27
Origin of the name “binomial coefficient”
(x + y )0 = 1
(x + y )1 = x +y
(x + y )2 = x 2 + 2xy + y 2
(x + y )3 = x + 3x 2 y + 3xy 2 + y 3
3

(x + y )4 = x + 4x 3 y + 6x 2 y 2 + 4xy 3 + y 4
4

(x + y )5 = x +5x 4 y +10x 3 y 2 +10x 2 y 3 +5xy 4 +y 5


5

Notice that the coefficients on the right are exactly the same as the entries in Pascal’s
triangle. Why does this happen? Think about expanding (x + y )3 and finding the
coefficient of xy 2 , for example.

(x + y )(x + y )(x + y ) = xxx + xxy + xyx + xyy


+ yxx + yxy + yyx + yyy
= x + 3x 2 y + 3xy 2 + y 3
3

The coefficient of xy 2 is 3 because we have three terms in the sum above that contain
two y ’s (underlined). This is because there are 32 ways to choose two of the three
factors in a term to be y ’s.
14 / 27
The binomial theorem

The same logic holds in general. The coefficient of x n−r y r in (x + y )n will be nr




because there will be nr ways to choose r of the n factors in a term to be y ’s. This
fact is called the binomial theorem.

15 / 27
The binomial theorem

The same logic holds in general. The coefficient of x n−r y r in (x + y )n will be nr




because there will be nr ways to choose r of the n factors in a term to be y ’s. This
fact is called the binomial theorem.

Binomial theorem: For any n ∈ N,

(x + y )n = n0 x n y 0 + n1 x n−1 y 1 + n
x n−2 y 2 +
  
2
n n
 1 n−1
x 0y n.

· · · + n−1 x y + n
n  
X n
= x n−r y r
r
r =0

15 / 27
Exercise
Find a pattern in the sums of the rows in Pascal’s triangle. Justify your pattern
by one of the following methods:
• Using the defining property of Pascal’s triangle, or
• Counting all the subsets of a set of size n in two different ways, or
• Using the binomial theorem.

(x + y )1 = x +y
2
(x + y ) = x + 2xy + y 2
2

(x + y )3 = x 3 + 3x 2 y + 3xy 2 + y 3
(x + y )4 = x 4 + 4x 3 y + 6x 2 y 2 + 4xy 3 + y 4
(x + y )5 = x 5 +5x 4 y +10x 3 y 2 +10x 2 y 3 +5xy 4 +y 5

16 / 27
Pn n

Ways to prove r =0 r = 2n :

Let sn = sum of entries in row n of the triangle


▶ Using the defining property of Pascal’s triangle, Each entry in the row n is the
sum of 2 entries above. Hence sn−1 = sn /2 or sn = 2sn−1 and s0 = 1.

17 / 27
Pn n

Ways to prove r =0 r = 2n :

Let sn = sum of entries in row n of the triangle


▶ Using the defining property of Pascal’s triangle, Each entry in the row n is the
sum of 2 entries above. Hence sn−1 = sn /2 or sn = 2sn−1 and s0 = 1.
▶ Counting all the subsets of a set of size n in two different ways, or nr = number


of subsets of size r from set of size n. sn = number of possible subsets of n


elements. Alternatively each element is either included or not (2 choices) so we
have 2n subsets.

17 / 27
Pn n

Ways to prove r =0 r = 2n :

Let sn = sum of entries in row n of the triangle


▶ Using the defining property of Pascal’s triangle, Each entry in the row n is the
sum of 2 entries above. Hence sn−1 = sn /2 or sn = 2sn−1 and s0 = 1.
▶ Counting all the subsets of a set of size n in two different ways, or nr = number


of subsets of size r from set of size n. sn = number of possible subsets of n


elements. Alternatively each element is either included or not (2 choices) so we
have 2n subsets.
▶ Using the binomial theorem nr are coefficients of x n−r y r in the expansion.


If we pick x = y = 1 then (x + y )n = 2n and x n−r y r = 1.


Hence coefficients must sum to 2n

17 / 27
Ten Best Friends
You could have a set made up of your ten best friends:

{alex, blair , casey , drew , erin, francis, glen, hunter , ira, jade}

18 / 27
Ten Best Friends
You could have a set made up of your ten best friends:

{alex, blair , casey , drew , erin, francis, glen, hunter , ira, jade}

Some of the friends play soccer and some play tennis:

Soccer = {alex, casey , drew , hunter }, Tennis = {casey , drew , jade}.

We can represent this information in a Venn diagram:

18 / 27
You can also use Venn Diagrams for 3 sets. Consider the third set:

Volleyball = {drew , glen, jade}.

19 / 27
You can also use Venn Diagrams for 3 sets. Consider the third set:

Volleyball = {drew , glen, jade}.

19 / 27
You can also use Venn Diagrams for 3 sets. Consider the third set:

Volleyball = {drew , glen, jade}.

The Universal Set U is the set containg all elements of interest. In our case it is our
Ten Best Friends. To show the Universal Set in a Venn diagram, we put a box around
the whole thing:

19 / 27
Venn diagrams

A Venn diagram consists of multiple overlapping closed curves, usually circles,


each representing a set. The points inside a curve labelled S represent elements
of the set S, while the points outside represent elements not in the set S.

The Venn diagram above shows which uppercase letters are shared by the Greek, Latin
and Russian alphabets

20 / 27
Applications in counting

Complement Rule: if A ⊂ U, then

|U \ A| = |U| − |A|.

21 / 27
Applications in counting

Complement Rule: if A ⊂ U, then

|U \ A| = |U| − |A|.

Addition Rule: if |A ∩ B| = 0, then

|A ∪ B| = |A| + |B|.

21 / 27
Applications in counting

Complement Rule: if A ⊂ U, then

|U \ A| = |U| − |A|.

Addition Rule: if |A ∩ B| = 0, then

|A ∪ B| = |A| + |B|.

More generally, we have


|A ∪ B| = |A| + |B| − |A ∩ B|

21 / 27
Applications in counting

Complement Rule: if A ⊂ U, then

|U \ A| = |U| − |A|.

Addition Rule: if |A ∩ B| = 0, then

|A ∪ B| = |A| + |B|.

More generally, we have


|A ∪ B| = |A| + |B| − |A ∩ B|
By the Complement Rule, it is equivalent to
|U \ (A ∪ B)| = |U| − |A| − |B| + |A ∩ B|.
21 / 27
Three sets
Suppose elements of U have three properties P1 , P2 , P3 . Let Aj be the set of elements
from U satisfying property Pj .

Then, the number of elements satisfying none of these properties is

|U| − |A1 | − |A2 | − |A3 |


+ |A1 ∩ A2 | + |A1 ∩ A3 | + |A2 ∩ A3 |
− |A1 ∩ A2 ∩ A3 |.

22 / 27
Inclusion-Exclusion principle

Suppose we have N properties P1 , . . . , PN . To count the number of elements of U


satisfying none of this properties you:

• Start with the value of |U|.


• For all j subtract the number of elements satisfying Pj .
• For all pairs {j, k} ⊂ {1, . . . N} add the number of elements satisfying both
Pj and Pk .
• For all triples {j, k, ℓ} ⊂ {1, . . . N} subtract the number of elements satisfy-
ing Pj , Pk and Pℓ .
..
.
• add the number of elements satisfying all properties P1 , . . . , PN multiplied
by (−1)N .

23 / 27
Exercise
In a class of 30 students, 19 are studying French, 12 are studying Spanish and 7
are studying both French and Spanish. How many students are not taking any
foreign languages?

24 / 27
Exercise
In a class of 30 students, 19 are studying French, 12 are studying Spanish and 7
are studying both French and Spanish. How many students are not taking any
foreign languages?

Let U be set of students in the class. Let F be the sets of students studying French.
Let S be the sets of students studying Spanish. By Inclusion-Exclusion, the number
studying neither is

24 / 27
Exercise
In a class of 30 students, 19 are studying French, 12 are studying Spanish and 7
are studying both French and Spanish. How many students are not taking any
foreign languages?

Let U be set of students in the class. Let F be the sets of students studying French.
Let S be the sets of students studying Spanish. By Inclusion-Exclusion, the number
studying neither is

|U| − |S| − |F | + |S ∩ F | = 30 − 12 − 19 + 7 = 6.

It’s also easy to solve this problem with a Venn diagram.


But if there were a lot more languages involved it becomes hard to draw a picture...

24 / 27
Exercise
How many numbers in {1, 2, . . . , 100} are not divisible by 2,3 or 5?

25 / 27
Exercise
How many numbers in {1, 2, . . . , 100} are not divisible by 2,3 or 5?

ANS:
(a) All numbers: 100
(b) “Bad” set includes numbers divisible by 2: 50, by 3: 33, by 5: 20
So far have 100 − 50 − 33 − 20 = −3 j k
100
(c) We double counted numbers that are divisible by both 2 & 3: 2×3 = 16,
 100 
by 2 & 5 (i.e. multiples of 10): 10, by 3 & 5: 15 = 6
So now have 100 − 50 − 33 − 20 + 16 + 10 + 6 = 29.
(d) Those numbers divisible by all 3 numbers have been included in (a), subtracted 3
times in (b), added back in 3 times
j in k(c). Hence, we need to subtract off those
100
divisible by all three numbers: 2×3×5 = 3
Final answer is 100 − (50 + 33 + 20) + (16 + 10 + 6) − 3 = 26

25 / 27
Pigeonhole principle

The pigeonhole principle is a reasonably obvious statement, but can still be very useful.

26 / 27
Pigeonhole principle

The pigeonhole principle is a reasonably obvious statement, but can still be very useful.

If n items are placed in m containers with n > m, then at least one container has
at least two items.

26 / 27
Pigeonhole principle

The pigeonhole principle is a reasonably obvious statement, but can still be very useful.

If n items are placed in m containers with n > m, then at least one container has
at least two items.

Example: If a drawer contains only blue, black and white socks and you take out four
socks without looking at them, then you are guaranteed to have two of the same
colour.

26 / 27
We can generalise the pigeonhole principle as follows.

If n items are placed in m containers, then at least one container has at least
n
⌈m ⌉ items.

n n n
In the above ⌈ m ⌉ means the smallest integer greater than m (or m “rounded up”,
what most programming languages call ceil(n/m)).

27 / 27
We can generalise the pigeonhole principle as follows.

If n items are placed in m containers, then at least one container has at least
n
⌈m ⌉ items.

n n n
In the above ⌈ m ⌉ means the smallest integer greater than m (or m “rounded up”,
what most programming languages call ceil(n/m)).

Example: If 21 tasks have been distributed between four processor cores, the busiest
core must have been assigned at least 6 tasks.

27 / 27
We can generalise the pigeonhole principle as follows.

If n items are placed in m containers, then at least one container has at least
n
⌈m ⌉ items.

n n n
In the above ⌈ m ⌉ means the smallest integer greater than m (or m “rounded up”,
what most programming languages call ceil(n/m)).

Example: If 21 tasks have been distributed between four processor cores, the busiest
core must have been assigned at least 6 tasks.

Exercise
There are 308 students enrolled in MAT9004. So there must be some month in
which at least x of them have a birthday. What is the highest value of x we can
be certain of?

ANS:

27 / 27
We can generalise the pigeonhole principle as follows.

If n items are placed in m containers, then at least one container has at least
n
⌈m ⌉ items.

n n n
In the above ⌈ m ⌉ means the smallest integer greater than m (or m “rounded up”,
what most programming languages call ceil(n/m)).

Example: If 21 tasks have been distributed between four processor cores, the busiest
core must have been assigned at least 6 tasks.

Exercise
There are 308 students enrolled in MAT9004. So there must be some month in
which at least x of them have a birthday. What is the highest value of x we can
be certain of?

ANS: The highest we can be sure of is x = ⌈ 308


12 ⌉ = 26.

27 / 27

You might also like