Download presentation
Presentation is loading. Please wait.
Published byEsmond Parks Modified over 8 years ago
1
Chapter 7 – Counting Techniques CSNB 143 Discrete Mathematical Structures
2
OBJECTIVES Student should be able to understand all types of counting techniques. Students should be able to identify the three techniques learned. Students should be able to use each of the counting techniques based on different questions and situations.
3
What, Which, Where, When 1. Permutation Redundant elements(Clear / Not Clear) Non-redundant elements(Clear / Not Clear) The use of n P r (Clear / Not Clear) 2. Combination Non-redundant elements(Clear / Not Clear) The use of n C r (Clear / Not Clear) 3. Pigeonhole Pigeonhole Principle(Clear / Not Clear) Identifying n and m(Clear / Not Clear)
4
Permutation An order of objects we count no. of sequence Theorem 1 If there are two tasks T 1 and T 2 are to be done in sequence. If T 1 can be done in n 1 ways, and for each of these ways T 2 can be done in n 2 ways, the sequence T 1 T 2 can be done in n 1 n 2 ways.
5
Example 1 T1 T2 2 ways 3 ways T1T2 T2T1 2 x3 = 6 ways 3x2 = 6 ways
6
Theorem 2 If there are k tasks T 1, T 2, T 3, …, T k are to be done in sequence. If T 1 can be done in n 1 ways, and for each of these ways T 2 can be done in n 2 ways, and for each of these n 1 n 2 ways, T 3 can be done in n 3 ways, and so on, then the sequence T 1 T 2 T 3 …T k can be done in n 1 n 2 n 3 …n k ways.
7
E.x 1: A label identifier, for a computer system consists of one letter followed by 3 digits. If repetition allowed, how many distinct label identifier are possible? 26 x 10 x10 x 10 = 26000 possible identifiers. Problem 1: How many different sequences, each of length r, can be formed using elements from set A if: a) elements in the sequence may be repeated? b) all elements in the sequence must be distinct?
8
Theorem 3 For problem 1 (a): Let A be a set with n elements and 1 r n. Then the number of sequences of length r that can be formed from elements of A, allowing repetitions, is n.n.n.n… = n r that is n is multiplied r times Ex 2: If A = { , , , }, how many words that can be build with length 3, repetition allowed? n = 4, r = 3, then n r = 4 3 = 64 words
9
Theorem 4 A sequence of r elements from n elements of A is always said as ‘permutation of r elements chosen from n elements of A’, and written as n P r or P(n, r) For problem 1 (b): If 1 r n, then n P r is the number of permutation of n objects taken r at a time, is n(n-1)(n-2)… (n-(r - 1)) When r = n, that is from n objects, taken r at a time from A, where r = n, it is a n P n or n factorial, written as n!.
10
Ex 3: Choose 3 alphabet from A = {a, b, c} 3 P 3 = 3! = 3.2.1 = 6, that are abc, acb, bac, bca, cab, cba. So, if there are n elements, taken r at a time, n P r = n.(n-1).(n-2)….. (n-(r-1)).(n-r).(n- (r+1))…..2.1 (n-r).(n-(r-1))….2.1 = n.(n-1).(n-2)….. (n-(r-1))
11
= n! (n - r)! Ex 4: If A = {p, q, r, s}, find the number of permutation for 3 elements. 4 P 3 = 4.3.2.1 1 = 4.3.2 = 24(ex: pqr, pqs, prq, prs, psq, psr, …….)
12
Ex 5: Choose 3 alphabets from A..Z 26 P 3 = 26.25.24.23 …. 3.2.1 23.22……3.2.1. = 26.25.24
13
Theorem 5 The number of distinguishable permutations that can be formed from a collection of n objects where the first object appears k 1 times, the second object appears k 2 times, and so on, is: n! k 1 !k 2 !…k i ! Ex 6: a) MISSISSIPPIb) CANADA a) 11!= 34650 1!4!4!2!
14
Exercise : A bank password consists of two letter of the English alphabet followed by two digits. How many different passwords are there? A coin tossed four times and the result of each toss is recorded. How many different sequences of head and tails are possible?
15
Combination Order does not matter. we count no. of subset Theorem 1 Let A be a set with |A| = n, and let 1 r n. Then the number of combinations of the elements of A, taken r at a time, written as n C r, is given by n C r = n! r! (n - r)!
16
Ex 7: If A = {p, q, r, s}, find the number of combination for 3 elements. 4 C 3 = 4.3.2.1 3.2.1.1 = 4 (ex: pqr, pqs, prs, qrs) (pqr, prq, rpq, rqp, all are the same)
17
Exercise: Compute each of the following: 7 C 7 b) 7 C 4 c) 16 C 5 Suppose that 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 and the remaining six characters are letter chosen from the English alphabet or a digit. How many different passwords are possible?
18
Pigeonhole Pigeonhole Principle is a principle that ensures that the data is exist, but there is no information to identify which data or what data. Theorem 1 If there are n pigeon are assigned to m pigeonhole, where m < n, then at least one pigeonhole contains two or more pigeons.
19
Ex 9: if 8 people were chosen, at least 2 people were being born in the same day (Monday to Sunday). Show that by using pigeonhole principle. Sol:Because there are 8 people and only 7 days per week, so Pigeonhole Principle says that, at least two or more people were being born in the same day. Note that Pigeonhole Principle provides an existence proof. There must be an object or objects with certain characteristic. In the above example, the characteristic is having born on the same day of the week. The pigeonhole principle guarantees that they are at least two people with
20
this characteristic but gives no information on identifying this people. Only their existence are guaranteed. In order to use pigeonhole principle we must identify pigeons (object) and pigeonholes (categories of the desired characteristic) and be able to count the number of pigeons and the number of pigeonholes.
21
Ex 10:Show that if any five numbers from 1 to 8 are chosen, two of them will add to 9. Two numbers that add up to 9 are placed in sets as follows: A 1 = {1, 8},A 2 = {2, 7},A 3 = {3, 6},A 4 = {4, 5} Sol:Each of the 5 numbers chosen must belong to one of these sets. Since there are only four sets, the pigeonhole principle tells us that two of the chosen numbers belong to the same set. These numbers add up to 9.
22
The Extended Pigeonhole Principle If there are m pigeonholes and more than 2m pigeons, three or more pigeons will have to be assigned to at least one of the pigeonholes. Notation If n and m are positive integers, then n/m stands for largest integer less than equal to the rational number n/m. 3/2 = 1, 9/4 = 2 6/3 = 2
23
Theorem 2 If n pigeons are assigned to m pigeonholes, then one of the pigeonholes must contain at least (n-1)/m + 1 pigeons.
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.