You are on page 1of 13

ISTANBUL AYDIN UNIVERSITY

FACULTY OF ENGINEERING
ELECTRICAL & ELECTRONICS ENGINEERING DEPT.

EEE247: DISCRETE MATHEMATICS

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.

 Example: In a contest entered by 100 people. How many different top-10


outcomes could be selected?!!

 Example: If a password is 6 – 8 letters and/or digits. How many passwords


could be there?!!!

Sum & Product Rules:

 Let “m” be the number of ways to do task 1, and “n” be the number of ways
to do task 2.

 Then, we have the following rules:

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.

Set Theoretic Version:

 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:

 The ways to do either task 1 or 2 are 𝐴 ∪ 𝐵 and 𝑨 ∪ 𝑩 = 𝑨 + 𝑩

 The ways to do both task 1 and 2 are 𝐴 × 𝐵 and 𝑨 × 𝑩 = 𝑨 . 𝑩


Dr. M. Alkrunz
30.11.2019 3
EEE247: Discrete Mathematics
Basic of Counting,,,
Examples:
 A student can choose a project from one of three lists. The three lists
contains 23, 15, and 19 possible projects respectively. How many possible
projects are there to choose from?!!
 The project are all distinct.
 Hence, total = 23 + 15 + 19 = 57 projects.

 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.

 A license contains a sequence of three letters followed by three digits. How


many different license plates are available?
 We have 26 letters in English (A to Z) and 10 digits (0 to 9).
 So, there are a total of: 26 × 26 × 26 × 10 × 10 × 10 = 17,576,000
possible license plates.

Letter Letter Letter Digit Digit Digit


26 26 26 10 10 10
Dr. M. Alkrunz
30.11.2019 5
EEE247: Discrete Mathematics
Basic of Counting,,,
Remarks:

 If the sets “A” and “B” are not disjoint, then 𝑨 ∪ 𝑩 = 𝑨 + 𝑩 − 𝑨 ∩ 𝑩

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

 A total of: 𝑨 ∪ 𝑩 = 𝑨 + 𝑩 − 𝑨 ∩ 𝑩 = 𝟒𝟎𝟎 + 𝟒𝟓𝟎 − 𝟐𝟎𝟎 = 𝟔𝟓𝟎

Dr. M. Alkrunz
30.11.2019 8
EEE247: Discrete Mathematics
Basic of Counting,,,
Pigeonhole Principle

 If there is “≥ 𝑘 + 1” objects that assigned to “𝑘”


places. Then, at least 1 place must be assigned “≥ 2”
objects.

 I mean, the number of pigeons is more than the


number of pigeonholes.

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.

 How many people must be selected from a collection of 15 married couples


to ensure that at least two of the chosen persons are married to each
other?
 The worst case to select 15 males or 15 females.
 Selection of 16 persons ensures that.

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.

Generalized Pigeonhole Principle


 If “N” objects are assigned to “K” places, then at least one place must be
assigned at least 𝑁Τ𝐾 objects.
Example:
 If there are (N = 280) students in class. There are (K = 52) weeks in the year.
 Therefore, there must be at least 1 week during year which at least
280Τ
52 = 6 students in the class have a birthday.
Dr. M. Alkrunz
30.11.2019 11
EEE247: Discrete Mathematics
*Questions

Dr. M. Alkrunz
30.11.2019 12
EEE247: Discrete Mathematics
*Thanks
Dr. M. Alkrunz
30.11.2019 13
EEE247: Discrete Mathematics

You might also like