Lecture 31 - Discrete Mathematics (MTH202) PDF

Summary

This lecture provides an overview of K-combinations and K-selections in discrete mathematics. The examples and exercises demonstrate how to compute and apply these concepts. The document is part of a larger course on discrete mathematics.

Full Transcript

Discrete Mathematics (MTH202) LECTURE 31 K-COMBINATIONS K-SELECTIONS K-COMBINATIONS: With a k-combinations the order in which the elements are selected does not matter and the elements cannot...

Discrete Mathematics (MTH202) LECTURE 31 K-COMBINATIONS K-SELECTIONS K-COMBINATIONS: With a k-combinations the order in which the elements are selected does not matter and the elements cannot repeat. DEFINITION: A k-combination of a set of n elements is a choice of k elements taken from the set of n elements such that the order of the elements does not matter and elements can’t be repeated. The symbol C(n, k) denotes the number of k-combinations that can be chosen from a set of n elements. NOTE: k-combinations are also written nC as or  n  k k    REMARK: With k-combinations of a set of n elements, repetition of elements is not allowed, therefore, k must be less than or equal to n, i.e., k ≤ n. EXAMPLE: Let X = {a, b, c}. Then 2-combinations of the 3 elements of the set X are: {a, b}, {a, c}, and {b, c}. Hence C(3,2) = 3. EXERCISE: Let X = {a, b, c, d, e}. List all 3-combinations of the 5 elements of the set X, and hence find the value of C(5,3). SOLUTION: Then 3-combinations of the 5 elements of the set X are: {a, b, c}, {a, b, d}, {a, b, e}, {a, c, d}, {a, c, e}, {a, d, e}, {b, c, d}, {b, c, e}, {b, d, e}, {c, d, e} Hence C(5, 3) = 10 PERMUTATIONS AND COMBINATIONS: EXAMPLE: Let X = {A, B, C, D}. The 3-combinations of X are: {A, B, C}, {A, B, D}, {A, C, D}, {B, C, D} Hence C(4, 3) = 4 The 3-permutations of X can be obtained from 3-combinations of X as follows. ABC, ACB, BAC, BCA, CAB, CBA ABD, ADB, BAD, BDA, DAB, DBA ACD, ADC, CAD, CDA, DAC, DCA BCD, BDC, CBD, CDB, DBC, DCB So that P(4, 3) = 24 = 4 · 6 = 4 · 3! Clearly P(4, 3) = C(4, 3) · 3! Page 1 of 6 © Copyright Virtual University of Pakistan Discrete Mathematics (MTH202) In general we have, P(n, k) = C(n, k) · k! In general we have, P(n, k) = C(n, k) · k! or P ( n, k ) C ( n, k ) = k! But we know that n! P ( n, k ) = ( n − k )! n! C ( n, k ) = Hence, (n − k )! k ! COMPUTING C(n, k) EXAMPLE: Compute C(9, 6). 9! SOLUTION: C (9,6) = (9 − 6)!6! 9 ⋅ 8 ⋅ 7 ⋅ 6! = 3!⋅ 6! 9 ⋅8⋅7 = 3⋅ 2 = 84 SOME IMPORTANT RESULTS (a) C(n, 0) = 1 (b) C(n, n) = 1 (c) C(n, 1) = n (d) C(n, 2) = n(n-1)/2 (e) C(n, k) = C(n, n – k) (f) C(n, k) + C(n, k + 1) = C(n + 1, k + 1) EXERCISE: A student is to answer eight out of ten questions on an exam. (a) Find the number m of ways that the student can choose the eight questions (b) Find the number m of ways that the student can choose the eight questions, if the first three questions are compulsory. SOLUTION: (a) The eight questions can be answered in m = C(10, 8) = 45 ways. (b) The eight questions can be answered in m = C(7, 5) = 21 ways. EXERCISE: An examination paper consists of 5 questions in section A and 5 questions in section B. A total of 8 questions must be answered. In how many ways can a student select the questions if he is to answer at least 4 questions from section A. SOLUTION: Page 2 of 6 © Copyright Virtual University of Pakistan Discrete Mathematics (MTH202) There are two possibilities: (a) The student answers 4 questions from section A and 4 questions from section B.The number of ways 8 questions can be answered taking 4 questions from section A and 4 questions from section B are C(5, 4) · C(5, 4) =5 · 5 = 25. (b) The student answers 5 questions from section A and 3 questions from section B.The number of ways 8 questions can be answered taking 5 questions from section A and 3 questions from section B are C(5, 5) · C(5, 3) =1 · 10 = 10. Thus there will be a total of 25 + 10 = 35 choices. EXERCISE: A computer programming team has 14 members. (a) How many ways can a group of seven be chosen to work on a project? (b) Suppose eight team members are women and six are men (i) How many groups of seven can be chosen that contain four women and three men (ii) How many groups of seven can be chosen that contain at least one man? (iii)How many groups of seven can be chosen that contain at most three women? (c) Suppose two team members refuse to work together on projects. How many groups of seven can be chosen to work on a project? (d) Suppose two team members insist on either working together or not at all on projects. How many groups of seven can be chosen to work on a project? (a) How many ways a group of 7 be chosen to work on a project? SOLUTION: Number of committees of 7 14 ! C (14, 7 ) = (14 − 7 ) !⋅ 7 ! 14 ⋅ 13 ⋅ 12 ⋅ 11 ⋅ 10 ⋅ 9 ⋅ 8 = 7 ⋅6⋅5⋅4 ⋅3⋅2 = 3432 (b) Suppose eight team members are women and six are men (i) How many groups of seven can be chosen that contain four women and three men? SOLUTION: Number of groups of seven that contain four women and three men 8! 6! C (8, 4) ⋅ C (6,3) = ⋅ (8 − 4)!⋅ 4! (6 − 3)!⋅ 3! 8⋅ 7 ⋅ 6 ⋅5 6 ⋅5⋅ 4 = ⋅ 4! 3! 8⋅ 7 ⋅ 6 ⋅5 6 ⋅5⋅ 4 = ⋅ 4 ⋅ 3⋅ 2 3⋅ 2 = 70 ⋅ 20 = 1400 Page 3 of 6 © Copyright Virtual University of Pakistan Discrete Mathematics (MTH202) (b) Suppose eight team members are women and six are men (ii) How many groups of seven can be chosen that contain at least one man? SOLUTION: Total number of groups of seven 14! C (14,7) = (14 − 7)!⋅ 7! 14 ⋅ 13 ⋅ 12 ⋅ 11 ⋅ 10 ⋅ 9 ⋅ 8 = 7 ⋅ 6 ⋅ 5⋅ 4 ⋅ 3⋅ 2 = 3432 Number of groups of seven that contain no men 8! C (8,7) = (8 − 7)!⋅7! =8 Hence, the number of groups of seven that contain at least one man C(14,7) – C(8, 7) = 3432 – 8 =3424 (b)Suppose eight team members are women and six are men (iii) How many groups of seven can be chosen that contain atmost three women? SOLUTION: Number of groups of seven that contain no women = 0 Number of groups of seven that contain one woman = C(8,1) ⋅ C(6,6) =8⋅1=8 Number of groups of seven that contain two women = C(8,2) ⋅ C(6,5) = 28 ⋅ 6 = 168 Number of groups of seven that contain three women = C(8,3) ⋅ C(6,4) = 56 ⋅ 15 = 840 Hence the number of groups of seven that contain at most three women = 0 + 8 + 168 + 840 = 1016 (c) Suppose two team members refuse to work together on projects. How many groups of seven can be chosen to work on a project? SOLUTION: Call the members who refuse to work together A and B. Number of groups of seven that contain neither A nor B 12! C (12,7) = (12 − 7)!⋅ 7! = 792 Number of groups of seven that contain A but not B C(12, 6) = 924 Number of groups of seven that contain B but not A C(12,6) = 924 Page 4 of 6 © Copyright Virtual University of Pakistan Discrete Mathematics (MTH202) Hence the required number of groups are C(12,7) + C(12,6) + C(12, 6) = 792 + 924 + 924 = 2640 (d)Suppose two team members insist on either working together or not at all on projects. How many groups of seven can be chosen to work on a project? SOLUTION: Call the members who insist on working together C and D. Number of groups of seven containing neither C nor D C(12, 7) = 792 Number of groups of seven that contain both C and D C(12, 5) = 792 Hence the required number = C(12, 7) + C(12, 5) = 792 + 792 = 1584 EXERCISE: (a) How many 16-bit strings contain exactly 9 1’s? (b)How many 16-bit strings contain at least one 1? SOLUTION: 16! (a) 16-bit strings that contain exactly 9 1’s= C (16,9) = = 11440 (16 − 9)!9! 16 (b) Total no. of 16-bit strings = 2 Hence number of 16-bit strings that contain at least one 1 16 2 – 1 = 65536 – 1 = 65535 K-SELECTIONS: k-selections are similar to k-combinations in that the order in which the elements are selected does not matter, but in this case repetitions can occur. DEFINITION: A k-selection of a set of n elements is a choice of k elements taken from a set of n elements such that the order of elements does not matter and elements can be repeated. REMARK: 1. k-selections are also called k-combinations with repetition allowed or multisets of size k. 2. With k-selections of a set of n elements repetition of elements is allowed. Therefore k need not to be less than or equal to n. THEOREM: The number of k-selections that can be selected from a set of n elements is k+n -1 C(k+n−1, k) or c k EXERCISE: A camera shop stocks ten different types of batteries. Page 5 of 6 © Copyright Virtual University of Pakistan Discrete Mathematics (MTH202) (a) How many ways can a total inventory of 30 batteries be distributed among the ten different types? (b) Assuming that one of the types of batteries is A76, how many ways can a total inventory of 30 batteries be distributed among the 10 different types if the inventory must include at least four A76 batteries? SOLUTION: (a) k = 30 n = 10 The required number is C(30 + 10 – 1, 30) = C(39, 30) 39! = (39 − 30)!30! = 211915132 (b) k = 26 n = 10 The required number is C(26 + 10 – 1, 26) = C(35, 26) 35! = (35 − 26)!26! = 70607460 WHICH FORMULA TO USE? ORDER ORDER DOES MATTERS NOT MATTER REPETITION k-sample k-selection ALLOWED nk C(n+k-1, k) REPETITION k-permutation k-combination NOT P(n, k) C(n, k) ALLOWED Page 6 of 6 © Copyright Virtual University of Pakistan

Use Quizgecko on...
Browser
Browser