0% found this document useful (0 votes)
38 views

Week 5 - (Part B) Counting Principles

This document provides an overview of counting principles covered in Week 5, including the sum and product rules, two-way counting, tree diagrams, the pigeonhole principle, and the inclusion-exclusion principle. It introduces examples to demonstrate each technique. The sum rule states that if outcomes from two events are mutually exclusive, the total outcomes is the sum of individual outcomes. The product rule gives the number of outcomes as the product of individual outcomes if events occur sequentially. Two-way counting combines sum and product rules. Tree diagrams list all outcomes systematically. The pigeonhole principle guarantees at least one non-empty container if objects exceed containers. The inclusion-exclusion principle calculates outcomes by adding sizes then subtracting intersections.

Uploaded by

Game Account
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)
38 views

Week 5 - (Part B) Counting Principles

This document provides an overview of counting principles covered in Week 5, including the sum and product rules, two-way counting, tree diagrams, the pigeonhole principle, and the inclusion-exclusion principle. It introduces examples to demonstrate each technique. The sum rule states that if outcomes from two events are mutually exclusive, the total outcomes is the sum of individual outcomes. The product rule gives the number of outcomes as the product of individual outcomes if events occur sequentially. Two-way counting combines sum and product rules. Tree diagrams list all outcomes systematically. The pigeonhole principle guarantees at least one non-empty container if objects exceed containers. The inclusion-exclusion principle calculates outcomes by adding sizes then subtracting intersections.

Uploaded by

Game Account
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/ 11

Week 5: Counting Principles

Section……………………………………………………………………………………………. Page

Section 0: Introduction to Counting Principles ……………………………………………………1

Section 1: Sum and Product Rule………………………...………………………………………...1


Section 1.1: Two-Way Counting…………………………………………………………………...3

Section 2: Tree Diagram for Solving Counting Problems…………………………………….…....4

Section 3: Pigeonhole Principle and Simple Examples…………………………………………….6

Section 4: Inclusion and Exclusion Principle (Sieve Formula).……………………………………8

Bibliography ………………………………………………………………………………………11

UU-MTH- 1005 Discrete Mathematics Page 1


Section 0: Introduction to Counting Principles

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.

Section 1: Sum and Product Rule

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 𝑐ℎ𝑜𝑖𝑐𝑒𝑠

If we have an experiment of events happening in a sequence, where 𝑛1 is the number of possible


outcomes for the first event and 𝑛2 is the number of possible outcomes for the second event, then the

UU-MTH- 1005 Discrete Mathematics Page 2


number of possible outcomes for the sequence of the two events is given by 𝑛1 × 𝑛2 . This is called the
product rule of counting and can be extended to a sequence of more than two events.

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

𝑛1 × 𝑛2 = 7 × 6 = 42 𝑤𝑎𝑦𝑠 𝑡𝑜 𝑎𝑠𝑠𝑖𝑔𝑛 𝑡ℎ𝑒 𝑑𝑖𝑓𝑓𝑒𝑟𝑒𝑛𝑡 𝑜𝑓𝑓𝑖𝑐𝑒𝑠 𝑡𝑜 𝑡𝑤𝑜 𝑒𝑚𝑝𝑙𝑜𝑦𝑒𝑒𝑠

Section 1.1: Two-Way Counting

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

How many four-digit numbers begin with 1 or 9?

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

UU-MTH- 1005 Discrete Mathematics Page 3


Third and finally, the number of four-digit numbers which begin with 1 or 9 will be found by adding the
two numbers found in the first and second steps:

𝑛1 + 𝑛2 = 1000 + 1000 = 2000

Section 2: Tree Diagram for Solving Counting Problems

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

From figure 2.1,

UU-MTH- 1005 Discrete Mathematics Page 4


There is a total of 8 outcomes, 7 outcomes have at least a 1, 3 outcomes have at most 2 ones, 3
outcomes have at least two ones appearing consecutively, …

Example 2.2

Toss a coin thrice,

i) How many possible outcomes would we have?


ii) How many of the possible outcomes would have a tail as the first outcome?
iii) How many of the outcomes would have a head and a tail as the first two consecutive
outcomes?

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: {𝐻𝑇𝐻, 𝐻𝑇𝑇}

UU-MTH- 1005 Discrete Mathematics Page 5


Section 3: Pigeonhole Principle and Simple Examples

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.

UU-MTH- 1005 Discrete Mathematics Page 6


If we pick four socks, it is possible that one may be white, another may be pink, the third one may be
blue and the fourth one may be white, pink or blue; hence, we will be guaranteed of having a
matching pair if we picked four socks.

Generalised Pigeonhole Principle


If more than 𝑘 × 𝑛 objects are placed into 𝑛 containers, then at least one container must have more than
𝑘 objects.

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

UU-MTH- 1005 Discrete Mathematics Page 7


Section 4: Inclusion-Exclusion Principle (Sieve
Formula)

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 ∩ 𝐴𝑖2 | + ∑ |𝐴𝑖1 ∩ 𝐴𝑖2 ∩ 𝐴𝑖3 | − ⋯


1≤𝑖1 ≤𝑛 1≤𝑖1 <𝑖2 ≤𝑛 1≤𝑖1 <𝑖2 <𝑖3 ≤𝑛

+ (−1)𝑛+1 | ⋂ 𝐴𝑖 |
1≤𝑖≤𝑛

= ∑ |𝐴𝑖1 | − ∑ |𝐴𝑖1 ∩ 𝐴𝑖2 | + ∑ |𝐴𝑖1 ∩ 𝐴𝑖2 ∩ 𝐴𝑖3 | − ⋯ + (−1)𝑛+1 |𝐴1 ∩ … ∩ 𝐴𝑛 |


1≤𝑖1 ≤𝑛 1≤𝑖1 <𝑖2 ≤𝑛 1≤𝑖1 <𝑖2 <𝑖3 ≤𝑛

The principle of inclusion and exclusion when 𝒏 = 𝟐

| ⋃ 𝐴𝑖 | = |𝐴1 ∪ 𝐴2 | = ∑ |𝐴𝑖1 | − ∑ |𝐴𝑖1 ∩ 𝐴𝑖2 |


1≤𝑖≤2 1≤𝑖1 ≤2 1≤𝑖1 <𝑖2 ≤2

|𝐴1 ∪ 𝐴2 | = |𝐴1 | + |𝐴2 | − |𝐴1 ∩ 𝐴2 |

The principle of inclusion and exclusion when 𝒏 = 𝟑

UU-MTH- 1005 Discrete Mathematics Page 8


| ⋃ 𝐴𝑖 | = |𝐴1 ∪ 𝐴2 ∪ 𝐴3 | = ∑ |𝐴𝑖1 | − ∑ |𝐴𝑖1 ∩ 𝐴𝑖2 | + ∑ |𝐴𝑖1 ∩ 𝐴𝑖2 ∩ 𝐴𝑖3 |
1≤𝑖≤3 1≤𝑖1 ≤3 1≤𝑖1 <𝑖2 ≤3 1≤𝑖1 <𝑖2 <𝑖3 ≤3

|𝐴1 ∪ 𝐴2 ∪ 𝐴3 | = |𝐴1 | + |𝐴2 | + |𝐴3 | − |𝐴1 ∩ 𝐴2 | − |𝐴1 ∩ 𝐴3 | − |𝐴2 ∩ 𝐴3 | + |𝐴1 ∩ 𝐴2 ∩ 𝐴3 |

The principle of inclusion and exclusion when 𝒏 = 𝟒

| ⋃ 𝐴𝑖 | = |𝐴1 ∪ 𝐴2 ∪ 𝐴3 ∪ 𝐴4 |
1≤𝑖≤4

= ∑ |𝐴𝑖1 | − ∑ |𝐴𝑖1 ∩ 𝐴𝑖2 | + ∑ |𝐴𝑖1 ∩ 𝐴𝑖2 ∩ 𝐴𝑖3 |


1≤𝑖1 ≤4 1≤𝑖1 <𝑖2 ≤4 1≤𝑖1 <𝑖2 <𝑖3 ≤4

− ∑ |𝐴𝑖1 ∩ 𝐴𝑖2 ∩ 𝐴𝑖3 ∩ 𝐴𝑖4 |


1≤𝑖1 <𝑖2 <𝑖3 <𝑖4 ≤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.

UU-MTH- 1005 Discrete Mathematics Page 9


Example 4.1

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

𝐴1 = {𝑆𝑡𝑢𝑑𝑒𝑛𝑡 𝑤ℎ𝑜 𝑤𝑖𝑙𝑙 𝑒𝑎𝑡 𝑠𝑎𝑢𝑠𝑎𝑔𝑒}


𝐴2 = {𝑆𝑡𝑢𝑑𝑒𝑛𝑡 𝑤ℎ𝑜 𝑤𝑖𝑙𝑙 𝑒𝑎𝑡 𝑝𝑒𝑝𝑝𝑒𝑟𝑜𝑛𝑖}
𝐴3 = {𝑆𝑡𝑢𝑑𝑒𝑛𝑡 𝑤ℎ𝑜 𝑤𝑖𝑙𝑙 𝑒𝑎𝑡 𝑒𝑥𝑡𝑟𝑎 𝑐ℎ𝑒𝑒𝑠𝑒}

Then,

|𝐴1 | = 13, |𝐴2 | = 10, |𝐴3 | = 12, |𝐴1 ∩ 𝐴2 | = 4 , |𝐴2 ∩ 𝐴3 | = 5, , |𝐴1 ∩ 𝐴3 | = 7 𝑎𝑛𝑑 , |𝐴1 ∩ 𝐴2 ∩
𝐴3 | = 3.

Using the equation where n=3, we have

|𝐴1 ∪ 𝐴2 ∪ 𝐴3 | = |𝐴1 | + |𝐴2 | + |𝐴3 | − |𝐴1 ∩ 𝐴2 | − |𝐴1 ∩ 𝐴3 | − |𝐴2 ∩ 𝐴3 | + |𝐴1 ∩ 𝐴2 ∩ 𝐴3 |


|𝐴1 ∪ 𝐴2 ∪ 𝐴3 | = 13 + 10 + 12 − 4 − 5 − 7 + 3 = 22

UU-MTH- 1005 Discrete Mathematics Page 10


Bibliography

Gersting J. L. (2014). Mathematical Structures for Computer Science (7th ed.).


W.H. Freeman and Company.

Rosen K. H. (2011). Discrete Mathematics and its applications (7th ed.).


McGraw Hill Education (India) Private Limited

Susanna S. E. (2010). Discrete Mathematics with Applications. (4th ed.).


Brooks/Cole Cengage Learning

UU-MTH- 1005 Discrete Mathematics Page 11

You might also like