csnb143 – discrete structure topic 6 – counting techniques part ii

14
CSNB143 – Discrete Structure Topic 6 – Counting Techniques Part II

Upload: giles-simpson

Post on 14-Jan-2016

219 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: CSNB143 – Discrete Structure Topic 6 – Counting Techniques Part II

CSNB143 – Discrete Structure

Topic 6 – Counting Techniques Part II

Page 2: CSNB143 – Discrete Structure Topic 6 – Counting Techniques Part II

Topic 6 – Counting TechniquesLearning Outcomes• Student should be able to explain all types of counting techniques.• Students should be able to distinguish the techniques learned. • Students should be able to use each of the counting techniques based on

different questions and situations.

Page 3: CSNB143 – Discrete Structure Topic 6 – Counting Techniques Part II

Topic 6 – Counting TechniquesMultiplication Principle of Counting

• If there are two tasks T1 and T2 are to be done in sequence. If T1 can be done in n1 ways, and for each of these ways T2 can be done in n2 ways, the sequence T1T2 can be done in n1n2 ways.

Page 4: CSNB143 – Discrete Structure Topic 6 – Counting Techniques Part II

Topic 6 – Counting TechniquesExample of implementation of multiplication principle of counting

A label identifier for computer system, consists of one letter followed bythree digits. If repetitions are allowed, use permutation to see how many label identifiers are possible.

Task 1 - Find possible selection of letters, n= 26, r = 1, repetition allowed using nr

Task 2 – Find possible selection of digits, n= 10, r =3, repetition allowed Using nr

Task 1 : 261

Task 2 : 103 Using multiplication principle Task 1 x Task 2

26 x 10 x 10 x 10 = 26000

Page 5: CSNB143 – Discrete Structure Topic 6 – Counting Techniques Part II

Topic 6 – Counting TechniquesDistinguishable Permutations

The number of distinguishable permutations can be formed from a collection of n objects where the first object appears k1 times, the second

appears k2 times, and so on

____n!____k1! k2! … kt!

Where k1 + k2 + K3 … kt = n

Try CANADA

Page 6: CSNB143 – Discrete Structure Topic 6 – Counting Techniques Part II

Topic 6 – Counting TechniquesExample of implementation

In how many ways can we select a committee of two women and three menfrom a group of five distinct women and six distinct men?

Task 1 - Find possible selection of women, n= 5, r = 2, repetition not allowed (distinct) using

Task 2 – Find possible selection of digits, n= 6, r =3, repetition not allowed(distinct) using

Page 7: CSNB143 – Discrete Structure Topic 6 – Counting Techniques Part II

Topic 6 – Counting TechniquesExample of implementation

Find the number of distinguishable permutation of the letters in PASCALFind the number of distinguishable permutation of the letters in REQUIREMENTS

Page 8: CSNB143 – Discrete Structure Topic 6 – Counting Techniques Part II

Topic 6 – Counting TechniquesExample of implementation

How many different seven-person committees can be formed each containingthree women from an available set of 20 women and four men from an available set of 30 men?• Permutation or Combination?• Repeated or not repeated?• Formula to be used?

Page 9: CSNB143 – Discrete Structure Topic 6 – Counting Techniques Part II

Topic 6 – Counting TechniquesExample of implementation

Supposed a valid computer password consists of seven characters, the first of which is a letter chosen from the set {A, B, C, D, E, F, G}, the remaining six characters are letters chosen from the English alphabet or a digit and may be repeated.• Permutation or Combination?• Repeated or not repeated?• Formula to be used?

Page 10: CSNB143 – Discrete Structure Topic 6 – Counting Techniques Part II

Topic 6 – Counting TechniquesExample of implementation

How many permutations of the letters ABCDEF contain the substring DEF?How many permutations of the letters ABCDEF contain the letters DEF together in any order?

Page 11: CSNB143 – Discrete Structure Topic 6 – Counting Techniques Part II

Topic 6 – Counting TechniquesExample of implementation

How many arrangement of the letters in the word BOUGHT can be formed if the vowels must be kept next to each other?

Page 12: CSNB143 – Discrete Structure Topic 6 – Counting Techniques Part II

Topic 6 – Counting TechniquesPigeonhole Principle

Pigeonhole Principle is a principle that ensures that the data exists, but there is no information to identify which data or what data.

Example: If there are n pigeons assigned to m pigeonholes, where the number of pigeons are more than the number of pigeonholes, then at least one pigeonhole will contain more than one pigeons.

Page 13: CSNB143 – Discrete Structure Topic 6 – Counting Techniques Part II

Topic 6 – Counting TechniquesPigeonhole Principle

Show that any five numbers from 1 to 8 are chosen, two of them will add to 9.

Solution:1, 2, 3, 4, 5, 6,7, 8, 9

2 numbers that add up to 9, placed in sets:A={1,8} B={2,7} C={3,6} D={4,5}Each of the 5 numbers chosen must belong to one of these sets. Since there are only 4 sets, the pigeonhole principle tells us that two of the chosen numbers belong to the same set

Page 14: CSNB143 – Discrete Structure Topic 6 – Counting Techniques Part II

Topic 6 – Counting TechniquesPigeonhole Principle

Example:

In a group of 8 people show that at least two have their birthday on the sameday of the week.

Solution:The people (8 of them) are the pigeons and the weekdays (7 of them) are the pigeon-holes.By the PHP, there is a weekday such that at least 2 people have that day as their birthday (proven)