Discrete Mathematics and its Applications Counting (2) Xiaocong ZHOU Department of Computer Science Sun Yat-sen University Feb. 2016 http://www.cs.sysu.edu.cn/ zxc isszxc@mail.sysu.edu.cn Xiaocong ZHOU (SYSU) Discrete Mathematics Feb. 2016 1 / 19
OUTLINE 1 Permutation 2 Combinations 3 The Binomial Theorem 4 Pascal s Identity and Triangle 5 Some Other Identities for Binomial Coefficients Xiaocong ZHOU (SYSU) Discrete Mathematics Feb. 2016 2 / 19
Introduction Permutation Many counting problems can be solved by finding the number of ways to arrange a specified number of distinct elements of a set of a particular size where the order of these elements matters Many other counting problems can be solved by finding the number of ways to select a particular number of elements from a set of a particular size where the order of the elements selected does not matter In how many ways can we select three students from a group of five students to stand in line for a picture? In how many ways can we arrange all five of these students in a line for a picture? Xiaocong ZHOU (SYSU) Discrete Mathematics Feb. 2016 3 / 19
Permutation Permutation A permutation( 排列 ) of a set of distinct objects is an ordered arrangement of these objects An ordered arrangement of r elements of a set is called an r-permutation Let S = {1, 2, 3} The ordered arrangement 3, 1, 2 is a permutation of S The ordered arrangement 3, 2, is a 2-permutation of S Xiaocong ZHOU (SYSU) Discrete Mathematics Feb. 2016 4 / 19
Permutation The number of r-permutations of a set with n elements is denoted by P(n, r) We can find P(n, r) using the product rule Let S = {a, b, c} The 2-permutations of S are the ordered arrangements a, b; a, c; b, a; b, c; c, a; and c, b. There are always six 2-permutations of a set with three elements there are three ways to choose the first element of the arrangement and two ways to choose the second element of the arrangement because it must be different from the first element Xiaocong ZHOU (SYSU) Discrete Mathematics Feb. 2016 5 / 19
Permutation Theorem Corollary If n is a positive integer and r is an integer with 1 r n, then there are P(n, r) = n(n 1)(n 2) (n r + 1) r-permutations of a set with n distinct elements If n and r are integers with 0 r n, then n! P(n, r) = (n r)! 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 context? Xiaocong ZHOU (SYSU) Discrete Mathematics Feb. 2016 6 / 19
Permutation Suppose that there are eight runners in race The winner receives a gold medal, the second-;lace finisher receives a silver medal, and the third-place finisher receives a bronze medal How many different ways are there to award these medals, if all possible outcomes of the race can occur and there are no ties? Suppose that a saleswoman has to visit eight different cities She must begin her trip in a specified city, but she can visit the other seven cities in any order she wishes How many possible orders can the saleswoman use when visiting these cities? How many permutations of the letters ABCDEFGH contain the string ABC? Xiaocong ZHOU (SYSU) Discrete Mathematics Feb. 2016 7 / 19
Combinations Combinations How many different committees of three students can be formed from a group of four students? An r-combination( 组合 ) of elements of a set is an unordered selection of r elements from the set Thus, an r-combination is simply a subset of the set with r elements Let S be the set {1, 2, 3, 4} Then {1, 3, 4} is a 3-combination from S Xiaocong ZHOU (SYSU) Discrete Mathematics Feb. 2016 8 / 19
Combinations Theorem The number of r-combinations of a set with n distinct elements is denoted by C(n, r) C(n, r) is also denoted by ( n r) and is called a binomial coefficient The number of r-combinations of a set with n elements equals n! n(n 1) (n r + 1) C(n, r) = = r!(n r)! r! where n is a nonnegative integer and r is an integer with 0 r n The r-permutations of the set can be obtained by forming the C(n, r) r-combinations of the set, and then ordering the elements in each r-combination, which can be done in P(r, r) ways P(n, r) = C(n, r) P(r, r) Xiaocong ZHOU (SYSU) Discrete Mathematics Feb. 2016 9 / 19
Combinations Corollary How many poker hands of five cards can be dealt from a standard deck of 52 card? How many ways are there to select 47 cards from a standard deck of 52 cards? Let n and r be nonnegative integers with r n. Then C(n, r) = C(n, n r) A combinatorial proof( 组合证明 ) of an identity is a proof uses counting arguments to prove that both sides of the identity count the same objects but in different ways Xiaocong ZHOU (SYSU) Discrete Mathematics Feb. 2016 10 / 19
Combinations How many ways are there to select five players from a 10-member tennis team to make a trip to a match at another school? How many bit strings of length n contain exactly r1s? Suppose that there are 9 faculty members in the mathematics department and 11 in the computer science department How many ways are there to select a committee to develop a discrete mathematics course at a school if the committee is to consist of three faculty members from the mathematics department and four from the computer science department? Xiaocong ZHOU (SYSU) Discrete Mathematics Feb. 2016 11 / 19
The Binomial Theorem The Binomial Theorem The Binomial Theorem gives the coefficients of the expansion of powers of binomial expressions A binomial expression is simply the sum of two terms, such as x + y The expansion of (x + y) 3 = (x + y)(x + y)(x + y) can be found using combinatorial reasoning To obtain a term of the form x 3 an x must be chosen in each of the sums, and this can be done in only one way Thus, the x 3 term in the product has a coefficient of 1 To obtain a term of the form x 2 y an x must be chosen in two of the three sums (and consequently a y in the other sum) Hence, the number of such terms is the number of 2-combinations of three objects, namely, ( 3) 2 Xiaocong ZHOU (SYSU) Discrete Mathematics Feb. 2016 12 / 19
The Binomial Theorem The Binomial Theorem Theorem (The Binomial Theorem) Let x and y be variables, and let n be a nonnegative integer. Then (x + y) n n ( n = j j=0 ( ) n = x n + 0 ) x n j y j ( ) n x n 1 y + 1 ( ) ( ) n n x n 2 y 2 + + xy n 1 + 2 n 1 ( ) n y n n What is the expansion of (x + y) 4? What is the coefficient of x 12 y 13 in the expansion of (2x 3y) 2 5? Xiaocong ZHOU (SYSU) Discrete Mathematics Feb. 2016 13 / 19
The Binomial Theorem Corollary Let n be a nonnegative integer. Then n ( ) n = 2 n k k=0 Let n be a nonnegative integer. Then ( ) n k = 0 n ( 1) k k = 0 This implies ( ) n 0 ( ) ( ) ( ) ( ) ( ) n n n n n + + + = + + + 2 4 1 3 5 Let n be a nonnegative integer. Then n ( ) n 2 k = 3 n k k=0 Xiaocong ZHOU (SYSU) Discrete Mathematics Feb. 2016 14 / 19
Pascal s identity Pascal s Identity and Triangle Theorem (Pascal s Identity) Let n and k be positive ( integers ) with ( n ) k. ( Then ) n + 1 n n = + k k 1 k Suppose that T is a set containing n + 1 elements. Let a T and S = T {a}. there are ( n+1) k subsets of T containing k elements a subset of T with k elements either contains a together with k 1 elements of S, or contains k elements of S and does not contain a Pascal s Identity, together with the initial conditions ( n 0) = ( n n) = 1 for all integers n, can be used to recursively define binomial coefficients This is useful in the computation of binomial coefficients because only addition, and not multiplication, of integers is needed to use this recursive definition Xiaocong ZHOU (SYSU) Discrete Mathematics Feb. 2016 15 / 19
Pascal s triangle Pascal s Identity and Triangle Pascal s Identity is the basis for a geometric arrangement of the binomial coefficients in a triangle This triangle is known as Pascal s triangle( 中国 : 贾宪三角 ) Xiaocong ZHOU (SYSU) Discrete Mathematics Feb. 2016 16 / 19
Some Other Identities for Binomial Coefficients Vandermonde s Identity Theorem (Vandermonde s Identity) Let m, n, and r be nonnegative integers with r m and r n. Then ( ) m + n r ( )( ) m n = r r k k k=0 Suppose that there are m items in one set and n items in a second set the total number of ways to pick r elements from the union is ( m+n) r Another way to pick r elements is to pick k elements from the first set and then r k elements from the second set, where k is an integer with 0 k r Corollary If n is a nonnegative integer, then ( ) 2n = n n k=0 ( ) 2 n k Xiaocong ZHOU (SYSU) Discrete Mathematics Feb. 2016 17 / 19
Some Other Identities for Binomial Coefficients Theorem Let n and r be nonnegative integers with r n. Then ( ) n + 1 n ( ) j = r + 1 r the left-hand side counts the bit strings of length n + 1 containing r + 1 ones the right-hand side counts the same objects by considering the cases corresponding to the possible locations of the final 1 in a string with r + 1 ones This final one must occur at position r + 1, r + 2,, or n + 1 j=r If the last one is the kth bit there must be r ones among the first k 1 positions, there are ( k 1) r such bit strings Summing over k with r + 1 k n + 1, we find that there are ( k 1 ) n ( j n + 1 = r r) k=r+1 j=r bit strings of length n containing exactly r + 1 ones Xiaocong ZHOU (SYSU) Discrete Mathematics Feb. 2016 18 / 19
Some Other Identities for Binomial Coefficients Assignment: Exercises after 6.3, No. 20, 30, and Exercises after 6.4, No. 16, 22 Further reading: Exercises after 6.4, No. 17, 21 Xiaocong ZHOU (SYSU) Discrete Mathematics Feb. 2016 19 / 19