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

DM_Lecture_04_Edited

The document outlines the basics of counting in discrete mathematics, covering rules such as Addition, Multiplication, Subtraction, and Division, which help in determining the number of outcomes in various scenarios. It also explains permutations, including those with and without repetition, and those involving indistinguishable objects. The content is intended for first-year students in the Faculty of Computing at the Sri Lanka Institute of Information Technology.

Uploaded by

upekshawaragoda1
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)
7 views

DM_Lecture_04_Edited

The document outlines the basics of counting in discrete mathematics, covering rules such as Addition, Multiplication, Subtraction, and Division, which help in determining the number of outcomes in various scenarios. It also explains permutations, including those with and without repetition, and those involving indistinguishable objects. The content is intended for first-year students in the Faculty of Computing at the Sri Lanka Institute of Information Technology.

Uploaded by

upekshawaragoda1
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/ 33

Sri Lanka Institute of Information Technology

Faculty of Computing

IT1160 - Discrete Mathematics

Dr. Mahima Weerasinghe

Year 01 and Semester 02

Department of Information Technology Year 01 and Semester 02 1 / 33


Counting I

Department of Information Technology Year 01 and Semester 02 2 / 33


The Basics of Counting

1 Introduction to Counting
2 Addition Rule (Sum Rule)
3 Multiplication Rule (Product Rule)
4 Subtraction Rule (Principle of Inclusion-Exclusion)
5 Division Rule
6 Permutations

Department of Information Technology Year 01 and Semester 02 3 / 33


Introduction to Counting

Definition
Counting is the process of determining the number of elements in a
set or the number of ways to arrange or choose objects.
Examples
Counting outcomes in a game
Determining possible combinations of clothes
Calculating the number of unique passwords that can be created

Department of Information Technology Year 01 and Semester 02 4 / 33


The Sum Rule

“If a task can be done either in one of n1 ways or in one of n2 ways, where
none of the set of n1 ways is the same as any of the set of n2 ways, then
there are n1 + n2 ways to do the task.”

If there are k mutually exclusive events:


Total possible outcomes: n1 + n2 + n3 + ... + nk

Department of Information Technology Year 01 and Semester 02 5 / 33


Example

Choosing a shirt from a set of shirts.

If there are 3 red shirts and 2 blue shirts, then the total number of choices
of selecting a shirt is:
3+2=5

Department of Information Technology Year 01 and Semester 02 6 / 33


Example

Choosing a representative from either 20 teachers or 50 students if no one


belongs to both groups.

Then the total number of choices:


20 + 50 = 70

Department of Information Technology Year 01 and Semester 02 7 / 33


Exercise

1 A student can choose a computer project from one of three lists. The
three lists contain 23, 15, and 19 possible projects, respectively. No
project is on more than one list. How many possible projects are there
to choose from?
2 A class has 10 boys and 15 girls. If one student is to be selected, how
many choices are there?

Department of Information Technology Year 01 and Semester 02 8 / 33


The Product Rule

”If a procedure consists of two tasks performed sequentially, where the


first task can be completed in n1 ways and each way of completing the
first task allows n2 ways to complete the second task, then the total
number of ways to complete the procedure is n1 × n2 ”

If a procedure consists of k sequential tasks:


Total possible outcomes: n1 × n2 × n3 × ... × nk

Department of Information Technology Year 01 and Semester 02 9 / 33


Example

The possible outcomes for flipping two coins are:

Total outcomes =2×2 = 4

Department of Information Technology Year 01 and Semester 02 10 / 33


Example
You have 3 appetizers and 4 main courses.

Multiply the number of choices for appetizers by the number of choices for
main courses:
3 × 4 = 12 combinations.

Department of Information Technology Year 01 and Semester 02 11 / 33


Exercise

1 How many outcomes are there when rolling a die and flipping a coin
at the same time?
2 A new company with just two employees, Sanchez and Patel, rents a
floor of a building with 12 offices. How many ways are there to assign
different offices to these two employees?
3 How many different bit strings of length seven are there?
4 How many different license plates can be made if each plate contains
a sequence of three uppercase English letters followed by three digits
(and no sequences of letters are prohibited, even if they are obscene)?

Department of Information Technology Year 01 and Semester 02 12 / 33


The Subtraction Rule

“If a task can be done in either n1 ways or n2 ways, then the number of
ways to do the task is n1 + n2 minus the number of ways to do the task
that are common to the two different ways.”

|n1 ∪ n2 | = |n1 | + |n2 | − |n1 ∩ n2 |

Department of Information Technology Year 01 and Semester 02 13 / 33


Example

Determining the number of bit strings of length 8 that satisfy at least one
of the following conditions:
starting with a 1 or ending with the two bits 0 0:

Possible outcomes = 128 + 64 − 32 = 160

Department of Information Technology Year 01 and Semester 02 14 / 33


The Division Rule

“If a task can be completed in n ways, but these n ways are grouped such
that exactly d of them correspond to the same result (or outcome), then
the total number of distinct ways to complete the task is dn ”

Department of Information Technology Year 01 and Semester 02 15 / 33


Example

Department of Information Technology Year 01 and Semester 02 16 / 33


The Pigeonhole Principle

“If k is a positive integer and k + 1 or more objects are placed into k


boxes, then there is at least one box containing two or more of the
objects.”

Department of Information Technology Year 01 and Semester 02 17 / 33


Example

Among any group of 367 people, there must be at least two with the
same birthday, because there are only 366 possible birthdays.
In any group of 27 English words, there must be at least two that
begin with the same letter, because there are 26 letters in the English
alphabet.
100
Among 100 people there are at least 12 ∼ 9 who were born in the
same month.

Department of Information Technology Year 01 and Semester 02 18 / 33


Exercise

1 Prove that in a group of 13 people, at least two were born in the


same month.
2 How many students must be in a class to guarantee that at least two
students receive the same score on the final exam, if the exam is
graded on a scale from 0 to 100 points?
3 If you have 15 balls and 7 boxes, prove that at least one box has at
least 3 balls.
4 What is the minimum number of students required in a discrete
mathematics class to be sure that at least six will receive the same
grade, if there are five possible grades, A, B, C, D, and F?

Department of Information Technology Year 01 and Semester 02 19 / 33


Permutations

1 Permutations without Repetition


2 Permutations with Repetition
3 Permutations with Indistinguishable objects

Department of Information Technology Year 01 and Semester 02 20 / 33


Permutation
A permutation is an ordered arrangement of objects.
The order in which the objects are arranged matters.

Department of Information Technology Year 01 and Semester 02 21 / 33


Permutation without Repetitions

Each object can be used only once in the arrangement.


If we have n distinct objects, the number of ways to arrange all of
them is:
P(n, r = n) = n × (n − 1) × (n − 2) × ... × 1 = n!
If we select and arrange r objects from a set of n distinct objects, the
number of r-permutations is:
n!
P(n, r ) = (n−r )!

Department of Information Technology Year 01 and Semester 02 22 / 33


Example

Imagine that you have 5 students. Consider arranging all five students

in a line for a picture.

n = 5, r = n = 5

P(n, n) = n!

p(5, 5) = 5! = 5 × 4 × 3 × 2 × 1 = 120

Department of Information Technology Year 01 and Semester 02 23 / 33


Example

Imagine you have 5 students. Now, you want to select 3 of them to


stand in line for a picture.

Department of Information Technology Year 01 and Semester 02 24 / 33


Exercise

1 How many ways are there to select a first-prize winner, a second-prize


winner, and a third-prize winner from 100 different people who have
entered a contest?
2 How many permutations of the letters ABCDEFGH contain the string
ABC ?

Department of Information Technology Year 01 and Semester 02 25 / 33


Permutation with Repetitions

Each object can be used more than once in the arrangement.


If we have n distinct objects and we want to arrange r objects
with repetition allowed, the number of arrangements is given by:
P = nr

Department of Information Technology Year 01 and Semester 02 26 / 33


Example

Imagine we have 3 letters: A, B, C. How many ways can we arrange 2


letters with repetition?
P = nr
n = 3, r = 2
P = 32
=9
Arrangements: AA, AB, AC, BA, BB, BC, CA, CB, CC

Department of Information Technology Year 01 and Semester 02 27 / 33


Permutations with Indistinguishable objects

Rearranging identical objects does not create new unique


arrangements.
The number of unique arrangements is:
n!
P= n1 !×n2 !×···×nk !
n: Total number of objects
n1 , n2 , ..., nk : Number of unique objects of each type

Department of Information Technology Year 01 and Semester 02 28 / 33


Example

How many unique arrangements can be made with the word

”MISSISSIPPI”?

n = 11
M:1 I :4 S :4 P:2
n!
P=
n1 ! × n2 ! × ... × nk !
11!
=
1! × 4! × 4! × 2!
= 34650

Department of Information Technology Year 01 and Semester 02 29 / 33


Summary

The Addition Rule, Multiplication Rule, Subtraction Rule, and


Division Rule together provide a framework for counting outcomes by
determining whether tasks are
mutually exclusive (Addition)
sequential (Multiplication)
overlapping (Subtraction)
repeated in groups (Division)
ensuring accurate and efficient enumeration of possibilities.

Department of Information Technology Year 01 and Semester 02 30 / 33


Summary

A permutation is an arrangement of items in a specific order, and the


order objects matters.
Permutation can be categorized into three types:
with repetition (where items can be repeated)
without repetition (where each item is used only once)
with indistinguishable objects (where some items are identical and
cannot be distinguished from each other)

Department of Information Technology Year 01 and Semester 02 31 / 33


Reference

Chapter 6- Discrete Mathematics and its Applications (7th Edition) by


Kenneth H. Rosen (McGraw-Hill, Inc., New York, 2011)

Department of Information Technology Year 01 and Semester 02 32 / 33


Thank You!

Department of Information Technology Year 01 and Semester 02 33 / 33

You might also like