: How many ways are there to select a first-prizewinner, a second prize winner, and a third-prize winnerfrom100different people who have entered a contest?Solution:P(100,3) =100∙ 99 ∙98=970,20037
Solving Counting Problems by CountingPermutationsExample: Suppose a saleswoman has to visit eightdifferent cities. She must begin her trip in a specifiedcity, but she can visit the other seven cities in anyorder.How many possible orders exist?Solution: The first city is chosen, and the rest are orderedarbitrarily. Hence the orders are:7! = 7∙6∙5∙4∙3∙2∙1 = 5040If you need to find the tour with the shortest path that visitsall the cities, do you need to consider all 5040 paths?38
Theorem: Ifnis a positive integer andris an integerwith 1≤r≤n, then there are࠵౷࠵?࠵ಏ࠵?,࠵ಓ࠵?=n(n−1)(n−2)∙∙∙(n−r+ 1)=࠵࠵?!࠵࠵?−࠵࠵?!r-permutations of a set with n distinct elements.Proof: Use the product rule.–The first element can be chosen innways.–The second element can be chosen inn−1 ways,..–until there are (n−(r−1)) ways to choose the lastelement.Note: P(n,0) = 1. There is only one way to order zeroelements.39
Solving Counting Problems byCounting PermutationsExample: How many permutations of the lettersABCDEFGHcontain the stringABC?Solution: We solve this problem by counting thepermutations of six objects,ABC,D,E,F,G, andH.6! = 6∙5∙4∙3∙2∙1 = 72040
CombinationsDefinition: Anr-combinationof elements of a set is anunorderedselection ofrelements from the set.Anr-combination is a subset withrelements.The number ofr-combinations of a set with n distinctelements is denoted byC(n,r).Notation:࠵శ࠵?࠵࠵?,࠵࠵?=࠵࠵?࠵࠵?is called abinomial coefficient.41
Example: CombinationsS= {a,b,c,d}{a,c,d} is a 3-combination from S.It is the same as {d,c,a} since the order does notmatter.C(4,2) = 6The 2-combinations of set {a,b,c,d} are six subsets:{a,b}, {a,c}, {a,d}, {b,c}, {b,d}, and {c,d}.42
CombinationsTheorem: The number ofr-combinations of a set withnelements,n≥r≥0, isProof:The P(n,r) r-permutations of the set can be obtained by–forming theC(n,r) r-combinations and then–ordering the elements in each which can be done inr! waysBy the product ruleP(n,r) =C(n,r) ∙r!The resultfollows.43