Week 5 - (Part B) Counting Principles
Week 5 - (Part B) Counting Principles
Section……………………………………………………………………………………………. Page
Bibliography ………………………………………………………………………………………11
Counting techniques play a very important role in finding numbers of ways of arranging objects of
given set. For example, if a network provider has to generate different telephone numbers of six digits
from a set of numbers {0, 1, …, 9}, counting techniques will help us know exactly how many of these
telephone numbers can be generated; hence, it will be known whether the demand will be met or not by
generating six-digit telephone numbers from a set {0, 1, …, 9}.
Of course, telling by the example given in the above paragraph, permutations and combinations form a
part of counting techniques. However, here we will look at other counting techniques in addition to
permutations and combinations.
Given an experiment with two events having 𝑛1 and 𝑛1 as numbers of their possible outcomes,
respectively; if the two events do not have any outcomes in common, the total number of possible
outcomes for either of the two events will be given by 𝑛1 + 𝑛2 . This is called the sum rule of counting
and can be extended to experiments with more than two events.
Example 1.1
In selecting a president for the student association at a university requires that a candidate be either a
second year or a third year student. If the university is only having 30 and 36 as numbers of second and
third year students respectively, how many choices are there for a presidency where none of the
students is doing both second and third year at the same time?
Solution 1.1
There are 30 ways of choosing a second year student and there are 36 ways of choosing a third year
student where choosing a second year student is never the same as choosing a third year student
because a student does not belong to both years of university at the same time. This satisfies the use of
the sum rule to find the number of choices we have for a president position; therefore, we have
𝑛1 + 𝑛2 = 30 + 36 = 66 𝑐ℎ𝑜𝑖𝑐𝑒𝑠
Example 1.2
A company with just two employees is renting a floor of a building with seven offices. In how many
ways can the different offices be assigned to the employees?
Solution 1.2
The first employee will have 7 offices to choose from and if one office is chosen by the first employee,
the second employee will have 6 offices from which to make a choice. This is a sequence of two events
in which we have
The two-way counting is where the sum rule and the product rule are used in collaboration to solve the
counting problem because just the sum rule or just the product rule cannot work out.
Example 2.1
Solution 2.1
This kind of problem involves first finding the number of four-digit numbers which begin with 1 by
product rule:
There is only 1 choice for the first position, there are 10 choices for the second, third and fourth
positions because 1 is also part of the choices. Therefore, the number of four-digit numbers which begin
with 1 is given by 𝑛1 ⋅ 𝑛2 ⋅ 𝑛3 ⋅ 𝑛4 = 1 ⋅ 10 ⋅ 10 ⋅ 10 = 1000
Second, also, find the number of four-digit numbers which begin with 9 by product rule:
There is only 1 choice for the first position, there are 10 choices for the second, third and fourth
positions because 9 is also part of the choices. Therefore, the number of four-digit numbers which begin
with 9 is given by 𝑛1 ⋅ 𝑛2 ⋅ 𝑛3 ⋅ 𝑛4 = 1 ⋅ 10 ⋅ 10 ⋅ 10 = 1000
A tree diagram plays a very cardinal role in simplifying counting problems by listing all possible
outcomes of a sequence of events in a systematic fashion. Since on a tree diagram we find listed all
possible outcomes of a sequence of events, it is possible to count these outcomes in any possible
manner of their occurrence they may be asked to be counted.
What we need first is to know how to construct a tree diagram. A tree diagram is usually constructed
from left, having a starting point (node) and branching off to the right, with each branch representing a
possible outcome of the event.
Example 2.1
Example 2.2
Solution 2.2
i) There are 8 possible outcomes: {𝐻𝐻𝐻, 𝐻𝐻𝑇, 𝐻𝑇𝐻, 𝐻𝑇𝑇, 𝑇𝐻𝐻, 𝑇𝐻𝑇, 𝑇𝑇𝐻, 𝑇𝑇𝑇}
ii) 4 outcomes have a tail as the first outcome: {𝑇𝐻𝐻, 𝑇𝐻𝑇, 𝑇𝑇𝐻, 𝑇𝑇𝑇}
iii) 2 outcomes have a head and a tail as the first two outcomes: {𝐻𝑇𝐻, 𝐻𝑇𝑇}
Imagine the case where we have four pigeons flying into three pigeonholes or ten pigeons flying into
nine pigeonholes; definitely, we will have the case where one pigeonhole will have more than one
pigeon.
The pigeonhole principle is derived from this same case given above; that, if more than 𝑛 pigeons fly
into 𝑛 pigeonholes, then at least one hole will end up with more than one pigeon.
Pigeonhole Principle
If more than 𝑛 objects are placed into 𝑛 containers, then at least one container will have more than one
object.
Example 3.1
A drawer contains ten pairs of socks of only three colours: white, pink and blue. If the socks are picked
without looking, how many socks must be picked to guarantee at least one matching pair?
Solution 3.1
If we pick two socks, it will be possible that one is white and another blue or one is pink and another is
blue; so they wouldn’t be a guarantee of a match.
If we pick three pairs, it is possible that one may be white, another may be pink and the third one may
be blue, hence, there wouldn’t be a guarantee of a matching pair.
Note: the previous definition of the pigeonhole principle is a special case where 𝑘 = 1.
Example 3.2
Suppose that from a group of 15 people each person is supposed to pick a number from 0 to 5. What
minimum number of people is needed in order to be sure that you have two people with the same
number?
Solution 3.2
If 5, then it possible that they would have picked 0, 1, 2, 3 and 4 which will not likely guarantee two
people with the same number.
If 6, then it possible that they would have picked 0, 1, 2, 3, 4 and 5 which will not likely guarantee two
people with the same number.
If 7, then it possible that they would have picked 0, 1, 2, 3, 4, 5 and the sixth one would pick 0, 1, 2, 3,
4 or 5 which will most likely guarantee two people with the same number. Therefore, 7 is the minimum
number for which we may be sure two people will have picked the same number.
Example 3.3
In a group of 20 people, each person has one pet that is a cat, a dog or a pig. What is the minimum
number of people you need to be sure two of them have the same type of pet?
Solution 3.3
A minimum of 4 people
Theorem
The principle of inclusion and exclusion, in its general form, states that for finite 𝑛 sets 𝐴1 , 𝐴2 , … , 𝐴𝑛
the following holds
| ⋃ 𝐴𝑖 | = |𝐴1 ∪ … ∪ 𝐴𝑛 |
1≤𝑖≤𝑛
+ (−1)𝑛+1 | ⋂ 𝐴𝑖 |
1≤𝑖≤𝑛
| ⋃ 𝐴𝑖 | = |𝐴1 ∪ 𝐴2 ∪ 𝐴3 ∪ 𝐴4 |
1≤𝑖≤4
|𝐴1 ∪ 𝐴2 ∪ 𝐴3 ∪ 𝐴4 |
= |𝐴1 | + |𝐴2 | + |𝐴3 | + |𝐴4 | − |𝐴1 ∩ 𝐴2 | − |𝐴1 ∩ 𝐴3 | − |𝐴1 ∩ 𝐴4 | − |𝐴2 ∩ 𝐴3 |
− |𝐴2 ∩ 𝐴4 | − |𝐴3 ∩ 𝐴4 | + |𝐴1 ∩ 𝐴2 ∩ 𝐴3 | + |𝐴1 ∩ 𝐴2 ∩ 𝐴4 | + |𝐴1 ∩ 𝐴3 ∩ 𝐴4 |
+ |𝐴2 ∩ 𝐴3 ∩ 𝐴4 | − |𝐴1 ∩ 𝐴2 ∩ 𝐴3 ∩ 𝐴4 |
We could go on even for inclusion-exclusion principle with 𝑛 ≥ 5, however, we should take note that at
every value of 𝑛 we either have addition or subtraction of the cardinality of the sets which call inclusion
and exclusion.
When we have |𝐴|, it means the number of elements in set A. For the principle of inclusion and
exclusion with 𝑛 = 2, we were required to find the sum of the numbers of elements in the single sets
and then subtract the number of elements in the intersection of two sets. And also, we see that for 𝑛 =
3, we summed up the numbers of elements in the single sets, then subtracted the number of elements in
the intersection of two sets and thirdly added the number of elements in the intersection of three sets.
We see that this suggested a pattern whereby for 𝑛 sets, we need to add the numbers of elements in the
single sets, subtract the numbers of element in the intersection of two sets, add the numbers of elements
in the intersection of three sets, subtract the numbers of elements in the intersection of four sets, etc.
A group of students plans to order a pizza. If 13 will eat sausage topping, 10 will eat pepperoni, 12 will
eat extra cheese, 4 will eat both sausage and pepperoni, 5 will eat both pepperoni and extra cheese, 7
will eat both sausage and extra cheese, and 3 will eat all three toppings. How many students are in the
group?
Solution 4.1
Let
Then,
|𝐴1 | = 13, |𝐴2 | = 10, |𝐴3 | = 12, |𝐴1 ∩ 𝐴2 | = 4 , |𝐴2 ∩ 𝐴3 | = 5, , |𝐴1 ∩ 𝐴3 | = 7 𝑎𝑛𝑑 , |𝐴1 ∩ 𝐴2 ∩
𝐴3 | = 3.