ch4.3

26
1 Section 4.3 Permutations & Combinations

Upload: swapnanilpt

Post on 09-Dec-2015

217 views

Category:

Documents


2 download

DESCRIPTION

3

TRANSCRIPT

Page 1: ch4.3

1

Section 4.3

Permutations & Combinations

Page 2: ch4.3

2

Permutation

• Set of distinct objects in an ordered arrangement

• An ordered arrangement of r members of a set is an r-permutation

• The number of r-permutations of a set with n elements is denoted P(n,r)

Page 3: ch4.3

3

Number of r-permutations in a set

• P(n,r) can be found using the product rule:P(n,r) = n(n-1)(n-2)* … *(n-r+1)

• This is true because the first element of a permutation can be chosen any one of n ways; for the second element, there are n-1 ways to choose; for the third, n-2, etc. until there are exactly (n-r+1) ways to choose the rth element

Page 4: ch4.3

4

Example 1

• There are 8 runners in a race. The winner gets a gold medal, the second place finisher gets a silver, and third place finisher a bronze. How many different ways are there to award medals, if all possible outcomes of the race are equally likely?

Page 5: ch4.3

5

Example 1

• There are 3 medals to be awarded, and 8 contenders for a medal

• So the number of ways to award a medal is the number of 3-permutations on a set of 8 elements

• P(8,3) = 8*7*6 = 336 ways to award medals

Page 6: ch4.3

6

Combinations

• An r-combination of elements of a set is an unordered selection of r elements from the set - so an r-combination is a subset with r elements

• The number of r-combinations in a set of n distinct elements is denoted by C(n,r) or (n

r)

• C(n,r) = n!/(r!(n-r)!)• if r<=n, C(n,r) = C(n,n-r)

Page 7: ch4.3

7

Example 2

• Suppose there are 12 students in a discrete math class, of whom 4 are taking CS2. How many possible combinations of 4 students are there?

• C(12,4) = 12!/(8!4!) = 495

Page 8: ch4.3

8

Example 3

• In how many ways can a set of 5 letters be chosen from the English alphabet?

• C(26,5) = 26!/(21!5!) = 65780

Page 9: ch4.3

9

Example 4

• A sadistic professor decides to inflict discrete math on students taking 2 of her other classes. If she selects 4 students from CS2 and 5 students from Software Design (ignoring for the moment the potential for overlap), how many combinations of victims can she choose if there are 16 students in CS2 and 12 in Software Design?

Page 10: ch4.3

10

Example 4

• Apply the product rule - the answer is the product of the the number of 4-combinations from a set of 16 and the number of 5-combinations from a set of 12:C(16,4) * C(12,5) = 12!/(7!5!) * 16!/(12!4!) =

792 * 1820 =

1,441,440

Page 11: ch4.3

11

Binomial Coefficients

• A number of the form (nr) is called a

binomial coefficient because the numbers occur as coefficients in the expansion of powers of binomial expressions (e.g. (a+b)n)

• Properties of binomial coefficients include Pascal’s Identity: Let n & k be positive integers with n k. Then C(n+1,k) = C(n,k+1) + C(n,k)

Page 12: ch4.3

12

Pascal’s Triangle

• Can arrange binomial coefficients in a triangle based on Pascal’s identity

• The nth row of the triangle consists of coefficients (nk), k=0, 1, … , n

• When 2 adjacent binomial coefficients are added, the value in the next row between them is produced

Page 13: ch4.3

13

Pascal’s Triangle

(00)

(10)(1

1) (2

0)(21)(2

2)(3

0)(31)(3

2)(33)

Consider (21) + (22) = (32)

derived from n=2, k=2C(3,2) = C(2,1) + C(2,2)

Page 14: ch4.3

14

Theorem 4• Let n be a positive integer; then

C(n,k) = 2n

• Proof: a set with n elements has 2n different subsets, each containing 0..n elements• There are C(n,0) subsets with 0 elements, C(n,1) subsets with 1 element, C(n,2) subsets with 2 elements, C(n,n) with n elements

So the summation above of C(n,k) counts the total number of subsets, which we already know is 2n

Page 15: ch4.3

15

Theorem 5 (Vandermonde’s Identity)

• Let m, n and r be non-negative integers with m r and n r

• Then C(m+n,r) = C(m, r-k)C(n,k)

Page 16: ch4.3

16

Proof of VanderMonde’s identity

• Couldn’t we just look at his driver’s license?

• Ahem - if one set contains m items and another contains n items, the total number of ways to pick r elements from the union of the 2 sets is C(m+n,r)

Page 17: ch4.3

17

Proof continued

• Another way to pick r elements would be to pick k elements from the first set and r-k elements from the second (r k 0)

• Using the product rule, this can be done C(m,k)C(n,r-k) ways

• Therefore, the total number of ways to pick r elements from the union = C(m+n, r) =

C(m,r-k)C(n,k)

Page 18: ch4.3

18

Binomial Theorem

• Binomial expression: an expression with 2 terms, e.g. x and y

• The binomial theorem gives the coefficients of the expansion of powers of binomial expressions, e.g. (x+y)n

Page 19: ch4.3

19

Binomial Theorem

• For example, the expansion of (x+y)4 can be found using combinatorial reasoning instead of multiplying out the terms

(x+y)4 = (x+y) (x+y) (x+y) (x+y)

• All products of a term in each of the sums are added; terms of the form x4, x3y, x2y2, xy3 and y4 arise

Page 20: ch4.3

20

Binomial Theorem

• To get x4, you must choose x from each sum; there is one way to do this, so the coefficient is 1

• To get x3y, you must choose x from 3 sums and y from one; the number of these is the number of 3-combinations in 4 objects, or C(4,3)

• By similar reasoning, the number of x2y2 terms is C(4,2), number of xy3 terms is C(4,3) and the number of y4 terms is 1

• So (x+y)4 = x4+4x3y+6x2y2+4xy3+y4

Page 21: ch4.3

21

Binomial Theorem

• Stated generally, the binomial theorem holds:

(x+y)n = C(n,j)xn-jyj

= (n0)xn+(n

1)xn-1y+(n2)xn-2y2+…+(n

n-1) xyn-1+(nn)yn

Page 22: ch4.3

22

Proof of Binomial Theorem

• The terms in the expanded product are of the form xn-jyj for j = 0,1,2, … ,n

• To count the number of terms of this form, it is necessary to choose n-j x’s from the n sums (the other j terms are y’s)

• So the coefficient of xn-jyj = C(n,n-j) = C(n,j) as the theorem states

Page 23: ch4.3

23

Example 5

• What is the expansion of (x+y)7?

(x+y)7 = C(7,0)x7 + C(7,1)x6y + C(7,2)x5y2 + C(7,3)x4y3 + C(7,4)x3y4 + C(7,5)x2y5 + C(7,6)xy6 + C(7,7)y7 =

x7+7x6y+21x5y2+35x4y3+35x3y4+21x2y5+7xy6+y7

Page 24: ch4.3

24

Examples 6 & 7

• What is the coefficient of x7y6 in (x+y)13?

• C(13,7) = 13!/(7!6!) = 6,227,020,800/5040*720 = 1716

• What is the coefficient of x5y8 in (x+y)13?

• C(13,5) = 13!/(5!8!) = 1287

Page 25: ch4.3

25

Example 8

• What is the coefficient of x10y9 in (2x-3y)19?

• (2x-3y)19 = C(19,j)(2x)19-j(-3y)j

• So coefficient of x10y9 = C(19,10)(2)10(-3)9 = -(19!/(10!9!))21039

Page 26: ch4.3

26

Section 4.3

Permutations & Combinations