Professional Documents
Culture Documents
FACULTY OF ENGINEERING
ELECTRICAL & ELECTRONICS ENGINEERING DEPT.
Basic of Counting- I
Instructor:
Dr. Mohammed Alkrunz
Electrical & Electronics Engineering Dept.
Basic of Counting,,,
The study of the number of ways to put things together into various
combinations.
Let “m” be the number of ways to do task 1, and “n” be the number of ways
to do task 2.
Dr. M. Alkrunz
30.11.2019 2
EEE247: Discrete Mathematics
Basic of Counting,,,
The Sum Rule: The task “do either task 1 or task 2, but not both” can be
done in (m+n) ways.
The Product Rule: The task “do both task 1 and task 2” can be done in (mn)
ways.
If “A” is the set of ways to do task 1, and “B” is the set of ways to do task 2,
and if “A” and “B” are disjoint, then:
How many integers between 1 and 100 (including 100) are even or end with
5?
Let “A” be the set of even integer between 1 and 100.
Then, 𝐴 = 2, 4, 6, … … , 100 and 𝑨 = 𝟓𝟎 elements.
Let “B” be the set of integers end with 5.
Then, 𝐵 = 5, 15, 25, … … , 95 and 𝑩 = 𝟏𝟎 elements.
So, by addition principle: 𝑨 ∪ 𝑩 = 𝑨 + 𝑩 = 𝟓𝟎 + 𝟏𝟎 = 𝟔𝟎
Dr. M. Alkrunz
30.11.2019 4
EEE247: Discrete Mathematics
Basic of Counting,,,
Examples:
How many different bit strings of length 7 are there?
Bits: either zero or one.
Each of the seven bits can be chosen in two ways.
So, there are a total of 𝟐𝟕 = 𝟏𝟐𝟖 different bit strings.
Examples:
How many bit strings of length 3 either start with 1 or end with 00?
Let “A” is the set of bit strings start with 1. Then: 𝑨 = 𝟒
Let “B” is the set of bit strings end with 00. Then: 𝑩 = 𝟐
0 0 0
𝑨∪𝑩 = 𝑨 + 𝑩 − 𝑨∩𝑩 = 𝟒+𝟐−𝟏=𝟓
0 0 1
0 1 0
𝑨 𝑩 𝑨∩𝑩 0 1 1
1 0 0 1 0 0 1 0 0
2 2 2 1 0 1
1 1 0
4 2 1
1 1 1
Dr. M. Alkrunz
30.11.2019 6
EEE247: Discrete Mathematics
Basic of Counting,,,
Examples:
How many bit strings of length 4 or less?
A total of: 𝟐𝟒 + 𝟐𝟑 + 𝟐𝟐 + 𝟐𝟏 = 𝟏𝟔 + 𝟖 + 𝟒 + 𝟐 = 𝟑𝟎
Find the number of three letters initials where none of the letters is
repeated?
A total of: 𝟐𝟔 × 𝟐𝟓 × 𝟐𝟒 = 𝟏𝟓, 𝟔𝟎𝟎
26 25 24
Find the number of three letters initials where the letters could be
repeated?
A total of: 𝟐𝟔 × 𝟐𝟔 × 𝟐𝟔 = 𝟏𝟕, 𝟓𝟕𝟔
26 26 26
Dr. M. Alkrunz
30.11.2019 7
EEE247: Discrete Mathematics
Basic of Counting,,,
Examples:
Count the set “S” of 3 digit numbers which begin or end with an even digit?
Even numbers are: 0, 2, 4, 6, 8
Assume “A” is the set of numbers begin with an even digit.
Assume “B” is the set of numbers end with an even digit.
Remember that the number can not begin with zero.
𝑨 𝑩 𝑨∩𝑩
4 10 10 9 10 5 4 10 5
400 450 200
Dr. M. Alkrunz
30.11.2019 8
EEE247: Discrete Mathematics
Basic of Counting,,,
Pigeonhole Principle
X XXX X XX X
X X XXX XX
X X X XX X X
9 places 9 places
10 pigeons 12 pigeons
Dr. M. Alkrunz
30.11.2019 9
EEE247: Discrete Mathematics
Basic of Counting,,,
Examples:
There are 101 possible numeric grades (0% - 100%) rounded to the nearest
integer. Also there are “> 𝟏𝟎𝟏” students in this class.
Therefore, there must be at least one (rounded) grade that will be shared
by at least 2 students.
Dr. M. Alkrunz
30.11.2019 10
EEE247: Discrete Mathematics
Basic of Counting,,,
Examples:
We have 5 possible grades: A, B, C, D, F. How many students do we need to
be sure that at least 6 students get the same grades?
If we have 25 students, then we can have 5 A’s, 5 B’s , ….. etc.
Then, if we have 26 students, we need to add a student to a grade which
then has 6 students.
Dr. M. Alkrunz
30.11.2019 12
EEE247: Discrete Mathematics
*Thanks
Dr. M. Alkrunz
30.11.2019 13
EEE247: Discrete Mathematics