You are on page 1of 26

Module 13

Fundamental
Principles of Counting

1. Sum Rule
2. Product Rule
3. Inclusion/ Exclusion
Counting
 Assume we have a set of objects with
certain properties
 Counting is used to determine the
number of these objects

Examples:
 Number of available phone numbers with 7
digits in the local calling area
 Number of possible match starters (football,
basketball) given the number of team
members and their positions
Basic counting rules
 Counting problems may be hard, and
easy solutions are not obvious
 Approach: simplify the solution by
decomposing the problem

Two basic decomposition rules:


 Product rule A count decomposes into a
sequence of dependent counts (“each
element in the first count is associated with
all elements of the second count”)
 Sum rule A count decomposes into a set of
independent counts (“elements of counts
are alternatives”)
Two basic decomposition rules

 Product rule A count decomposes into


a sequence of dependent counts
(“each element in the first count is
associated with all elements of the
second count”)
 Sum rule A count decomposes into a
set of independent counts (“elements
of counts are alternatives”)
Sum Rule Principle
Assume some event E can occur in m ways and a
second event F can occur in n ways, and suppose
both events cannot occur simultaneously. Then E or
F can occur in m + n ways.

 Ingeneral, if there are n events and no two


events occurs in same time then the event can
occur in n1+n2..........n ways.
Sum Rule Principle
Example: If 8 male professor and 5 female
professor teaches Discrete Math , how many ways
can the student choose professor ?

8+5=13 ways.
Sum Rule Principle
Example: The mathematics department must
choose either a student or a faculty member as a
representative for a university committee. How
many choices are there for this representative if
there are 37 members of the mathematics faculty
and 83 mathematics majors and no one is both a
faculty member and a student?
Sum Rule Principle
Example: The mathematics department must
choose either a student or a faculty member as a
representative for a university committee. How
many choices are there for this representative if
there are 37 members of the mathematics faculty
and 83 mathematics majors and no one is both a
faculty member and a student?

8+5=13 ways.
Product Rule
Product rule .If some procedure can be
performed in many different ways & if FF. this
procedure, a 2nd procedure, a 3rd procedure
can be performed in different ways & so 4th ,
then the no. of ways the procedure can be
performed in order indicate is the product.
n x n, x n2 x … ways
Product Rule
Product rule .If some procedure can be
performed in many different ways & if FF. this
procedure, a 2nd procedure, a 3rd procedure
can be performed in different ways & so 4th ,
then the no. of ways the procedure can be
performed in order indicate is the product.
n x n, x n2 x … ways
Fundamental Principles Of Counting
 Example:
1. A coin is tossed twice. Determine the number
of different possible outcome by using FPC & list
the outcomes using tree diagram.
Fundamental Principles Of Counting
 Example:
2. A die is rolled & a coin is tossed. Determine
the number of different possible outcome using
free diagram & FPC.
Fundamental Principles Of Counting
 Example:
3. A ECE 212 students are taking true/false test in
which they are supposed to answer 3 questions
 Use FPC to determine the number of possible
answer in this test.
 Show all possible answers using tree diagram.
Fundamental Principles Of Counting
 Example:
4. Suppose a car plate number consists of 3
distinct letters followed by 3 digits with first digit
not zero. How many car plate numbers can be
made?
inclusion-exclusion principle
When counting the possibilities, we
can’t include a given outcome
more than once!

| A1 U A2 | = | A1 | + | A2 | - | A1 ∩ A2 |

*where |S| denotes the cardinality, or number of


elements, of set S in set notation.
inclusion-exclusion principle
 To prove this statement, we will show that every
element which belongs in one of these sets is
counted exactly once, and every element that is
not in these sets is counted exactly zero times.
 Case 1. Element is not in A, and not in B.
It is obvious it is counted zero times in the LHS.
inclusion-exclusion principle
 Case 2. Element is in A, and not in B.
It will be counted once on the Left Hand Side. On
the Right Hand Side, it is counted once in |A|.
inclusion-exclusion principle
 Case 3. Element is not in A, and is in B.
It will be counted once on the Left Hand Side. On
the Right Hand Side, it is counted once in ∣B∣.
inclusion-exclusion principle
 Case 4. Element is in A, and in B.
It will be counted once on the Left Hand Side. On the Right
Hand Side, it is counted +1 in ∣A∣, +1 in ∣B∣ and −1 in ∣A∩B∣.
Hence, it is counted exactly once.
inclusion-exclusion principle

| A1 U A2 | = | A1 | + | A2 | - | A1 ∩ A2 |

Let A1 have 5 elements, A2 have 3


elements, and 1 element be both in
A1 and A2
Total in the union is 5+ 3-1 = 7, not 8
inclusion-exclusion principle

How many integers from 1 to 100 are multiples of 2


or 3?
Let
A (set of integers from 1 to 100/multiples of 2) ∣A∣=50.
B (set of integers from 1 to 100/multiples of 3) ∣B∣=33.
∣A∩B∣ (set of integers from 1 to 100/multiples of 2 and 3)
∣A∩B∣=16.
∣A∪B∣=∣A∣+∣B∣−∣A∩B∣=50+33−16=67
inclusion-exclusion principle
Three Sets and More
∣A∪B∪C∣=∣A∣+∣B∣+∣C∣−∣A∩B∣−∣A∩C∣−∣B∩C∣+∣A∩B∩C∣
inclusion-exclusion example
There are exactly three types of students in a school: the
geeks, the wannabees, and the athletes. Each student is
classified into at least one of these categories. And the total
number of students in the school is 1000. Suppose that the
following is given:
 The total number of students who are geeks is 310.
 The total number of students who are wannabees is 650.
 The total number of students who are athletes is 440.
 The total number of students who are both geeks and
wannabees is 170.
 The total number of students who are both geeks and
athletes is 150.
 The total number of students who are both wannabees
and athletes is 180.
What is the total number of students who fit into all 3
categories?
inclusion-exclusion example
There are exactly three types of students in a school: the geeks, the wannabees, and the
athletes. Each student is classified into at least one of these categories. And the total number of
students in the school is 1000. Suppose that the following is given:
 The total number of students who are geeks is 310.
 The total number of students who are wannabees is 650.
 The total number of students who are athletes is 440.
 The total number of students who are both geeks and wannabees is 170.
 The total number of students who are both geeks and athletes is 150.
 The total number of students who are both wannabees and athletes is 180.
What is the total number of students who fit into all 3 categories?

Let G,W,A denote the set for geeks, wannabees, and athletes, respectively.
Then by the principle of inclusion and exclusion, we have

n(GUWUA) = n(G) + n(W) + n(A) - n(W∩G) - n(G∩A) - n(W∩A) + n(G∩W∩A )

which gives us
1000 = 310 + 650 + 440 - 170 - 150 - 180 + n(G∩W∩A )
1000=900 + n(G∩W∩A )
100 students will fit into all 3 categories
inclusion-exclusion example
We have 7 balls each of different colors (red, orange,
yellow, green, blue, indigo, violet) and 3 boxes each
of different shapes (tetrahedron, cube,
dodecahedron). How many ways are there to place
these 7 balls into the 3 boxes such that each box
contains at least 1 ball?
inclusion-exclusion example
Let X be the total number of ways we can distribute the balls if there are
no restrictions. Each ball can be placed into any one of the 3 boxes,
so ∣X∣=37.
Let T be the set of ways such that the tetrahedron box has no balls, C
the set of ways such that the cube box has no balls, and D the set of
ways such that the dodecahedron box has no balls. We would like to
find
∣X∣−∣T∪C∪D∣
We have |T| = |C| = |D| = 27, since the balls can be placed into one
of the two other boxes, and |T ∩ C | = |C ∩ D| = |D ∩ T| = 17,
since all the balls must be placed in the remaining box,
and ∣T∩C∩D∣=0.

∣X∣−∣T∪C∪D∣= 37 −3× 27 +3× 17 −0=1806

You might also like