Presentation is loading. Please wait.

Presentation is loading. Please wait.

Permutations and Combinations

Similar presentations


Presentation on theme: "Permutations and Combinations"— Presentation transcript:

1 Permutations and Combinations
Probability Permutations and Combinations Permutations and Combinations

2 Permutations and Combinations
Example What are the possible permutations and combinations of a, b, c a b c ab ac bc ba ca cb abc bca cab cba acb bac Permutations and Combinations

3 Permutations and Combinations
This lecture distinguishes between the ways of determining the probability of combining elements where the order does and does not matter. Permutations and Combinations

4 Permutations and Combinations
Example (con’t) 3P3 = n! = 3x2x1 = 6 3P1= 3!/(3-1)! = 3 3P2= 3!/(3-2)! = 6 3C3= 3!/3!(3-3)! = 1 3C2= 3!/2!(3-2)! = 3 3C1= 3!/1!(3-1)! = 3 Permutations and Combinations

5 Permutations and Combinations
A permutation is an arrangement of all or part of a set of objects: P = n! What are the possible permutations of a, b, c? (3)(2)(1) = 3! = 6 Permutations and Combinations

6 Permutations and Combinations
The number of permutations of n distinct objects taken r at a time nPr= n!/(n-r)! How many ways can a local section schedule 3 speakers for 3 meetings if available for 5 different nights? 5P3=5!/2!=60 Permutations and Combinations

7 Permutations and Combinations
The number of distinct permutations of n things of which ni are distinct kinds is n!/n1!n2!n3!…. Ex: How many ways can 3 yellow, 4 red and 2 blue bulbs be arranged on a Xmas tree? 9!/3!4!2! = 1260 Permutations and Combinations

8 Permutations and Combinations
For counting ways in which n different things can be ordered or arranged. These outcomes are not independent. n! Example Old MacDonald had on his farm 7 animals: goat G turkey T hen H pig P cow C dog D rat R If they each walk into the barn at night in single file, how many ways are there for them to enter the barn? 7! = 7x6x5x4x3x2x1 = 5040 Permutations and Combinations

9 Permutations Taken r at a Time
This is where things start to get hairy. nPr = n!/(n-r)! Example How many ways are there for 2 of MacDonald’s 7 animals to enter the barn? 7P2 = 7!/(7-2)! = 7!/5! = 7x6 = 42 There are 7 ways to choose the 1st animal, 6 ways to choose the 2nd. GT, GH, GP, GC, GD, GR = 6 1 TG, TH, TP, TC, TD, TR = 6 2 HG, HT, HP, HC, HD, HR = 6 3 PG, PT, PH, PC, PD, PR = 6 4 CG, CT, CH, CP, CD, CR = 6 5 DG, DT, DH, DP, DC, DR = 6 6 RG, RT, RH, RP, RC, RD = x 7 = 42 Note that we cannot use HH since there is only one hen: the objects are distinct. Note that order matters: GT ≠ TG. It is NOT like asking, “How many ways are there for two of the animals to be in the barn at the same time?” Permutations and Combinations

10 Permutations Taken r at a Time
Example Find the number of ways two cards can be drawn from a deck. 52P2 = 52!/(52-2)! = 52x51 Example What is the total number of ways to choose 5 of you to come to the board to work the next five examples (each student only asked once)? There are 27 students, so 27P5 = 27!/(27-5)! =27!/22! = 27*26*25*24*23 Permutations and Combinations

11 More Complicated Problems: Counting
Problems that involve breaking the problem into parts. Example (2.18 in the book) A president and a treasurer are to be chosen from 50 people. How many choices are possible if A does not want to be treasurer? This removes some of the degrees of freedom. You need to think carefully about how to calculate this. 1. A is selected president, leaving 49 choices for treasurer. 2. Of the remaining 49 people, there are 49P2 = 49 x 8 = 2352. Total number is = 2401. Another way 1. There are 50P2 = 50 x 49 = 2450 ways total. 2. Of these, 49 involve A as treasurer. Total number is 2450 – 49 = 2401. Permutations and Combinations

12 Permutations and Combinations
Counting Example How many ways can MacDonald’s animals enter the barn if the dog and the pig are best of friends and always stand next to each other in line? There are 6 ways for the dog to go first, and 6 ways if the pig goes first. 1 D P x 2 3 4 5 6 1 P D x 2 3 4 5 6 The other five animals can go in in 5! ways for each case. The total number of ways is then (6 + 6) x 5! = 12 x 5! = 12 x 120 = 1440 Reality check: is this number less than 5040? Yes. Another way to think about this: Treat DP as one object, so that in fact you have 6! ways. Also, you can treat PD as on object, and have 6! ways. 6! + 6! = 720 x 2 = 1440. Permutations and Combinations

13 Permutations and Combinations
Counting Example If you throw 5 dice, how many ways are there to get 4 faces showing one number, and the fifth face showing another? There are 6 “objects” (faces) and they are chosen 2 at a time (one for the 4 of a kind and one for the one of a kind). There are 5 dice, so 5 places to put the one of a kind. 6P2 ways to choose pairs of numbers to have 4 of one kind and 1 of another and 5 ways to choose the numbers in the pair. = 5 x (6!/4!) = 150 ways There are 6 ways to chose the first number showing, and 5 ways to chose the 2nd number showing and 5 ways to put the 1 of a kind on one of the dice. Permutations and Combinations

14 Permutations and Combinations
Counting continued: another way Permutations and Combinations

15 Permutations, continued
Number of distinct permutations of n things, of which n1 are of one kind, n2 of another, ... nk of a kth kind : n! / n1!n2!…nk! distinct means axx ≠ xax ≠ xxa (order matters) You need to divide by the degrees of freedom associated with the nk things being identical. Example In this class, how many ways are there to line up the boys and girls? There are n = 27 students of 2 kinds, n1 = 18 boys and n2 = 9 girls. There are 27!/18!9! = 4,686,825. Permutations and Combinations

16 Permutations, continued
Example How many ways are there to allow n business class, m first class, and r economy class passengers on an airplane? (n+m+r)!/n!m!r! Example How many ways are there to arrange hearts, diamonds, spades, and clubs in a deck of cards? Black and red cards? 52!/13!13!13!13! = 8.1 x 1067 /(6 x 109)4 = 8.1 x 1067 /1.5 x 1039 = 5.4 x 1028 52!/26!26! = 8.1 x 1067 /(4.0 x 1026)2 = 8.1 x 1067 /1.6 x 1053 = 5.1 x 1014 Permutations and Combinations

17 Permutations and Combinations
Partition into Cells Number of ways to partition n things, of which n1 are of one kind, n2 of another, ... nk of a kth kind, into r subsets (cells) : axx = xax = xxa (order does not matter) where n1 + n nk = n The same equation as for distinct permutations of n things, of which n1 are of one kind, n2 of a second, etc. Example In this class, how many ways are there to choose a team of four people? There are n = 27 students. The number of ways is 27!/4!23! = 27*26*25*24/4*3*2 = 17,550 Once can think of this as (27!/23!)/4! Example In this class, how many ways are there to choose a team of four people comprising 2 boys and 2 girls? There are 9 girls and 18 boys. Use the multiplication rule. The number of ways is (9!/7!2!)*(18!/16!2!) = (9*8/2) * (18*17/2) = 36 * 153 = 5,508 Reality check: this number is less than 17,550. Permutations and Combinations

18 Permutations and Combinations
Partition into Cells Example If you throw 4 coins, how many ways are there to get 2 faces showing heads, and 2 faces showing tails? There are n = 4 coins. The number of ways is 4!/2!2! = 24/4 = 6 H H T T H T T H H T T H T T H H H T T H T H H T Permutations and Combinations

19 Permutations vs. Partition into Cells
Permutations Order matters, but some items are identical. Example How many ways are there to arrange 3 red, 4 yellow, and 2 blue lights in 9 sockets of a string of lights? 9!/3!4!2! = 1260 Partitions Order doesn’t matter, but items are distinct. Example How many ways are there to partition 9 objects into 3 cells with 3 elements in the first cell, 4 in the second, and 2 in the third? 9!/3!4!2! = 1260 Permutations and Combinations

20 Permutations and Combinations
Partition into Cells Example Back to the farm. How many ways are there to put the following animals into 2 stalls, where the first stall will hold 3 and the second 2? goat G turkey T hen H pig P cow C 5!/3!2! = 5x4x3x2x1/3x2x1x2x1 = 120 / 6x2 = 10 There are 5! ways to permute the animals, but 3! permutations give you the same animals in the first stall and 2! permutations give you the same animals in the 2nd stall. Permutations and Combinations

21 More Complicated Problems
Example What if you had 3 animals and wanted to know how many ways they could fit into 2 stalls, with each stall holding up to 3 animals? Break the problem into pieces. 3!/3!0! + 3!/2!1! + 3!/1!2! + 3!/0!3! = 8 C H P | Ø C H | P C | H P Ø | C H P C P | H H | C P H P | C P | C H Permutations and Combinations

22 Permutations and Combinations
The number of combinations of n distinct objects taken r at a time is nCr = n!/r!(n-r)! The difference from permutations is the addition of the r! in the denominator, which cancels out the distinguishing of individual elements Permutations and Combinations

23 Permutations and Combinations
A partition into 2 subsets (cells). The number of combinations of n distinct objects taken r at a time: n choose r Example If you throw 4 dice, how many ways are there to get 2 faces showing one number, and 2 faces showing another? Same problem as before. Permutations and Combinations

24 More Complicated Problems
Example If you throw 5 dice, how many ways are there to get 2 faces showing one number, 2 faces showing another number and the fifth face showing another? There are 6 “objects” (faces) and they are chosen 3 at a time (one for the first 2-of-a-kind, one for the 2nd 2-of-a-kind, and one for the 1-of-a-kind) = 6P3 ways. There are 5 dice, so there are 5 places to put the one of a kind. With the remaining 4 dice, there are 6 ways to place the pairs. = (6!/3!) x 5 x 6 = 120 x 30 = 3600 ways There are 6 ways to chose the first number, 5 ways to chose the 2nd number, and 4 ways to chose the third number, then 5 positions where the first number can appear, and 4P2 = (4!/2!2!)= 6 positions where the other two numbers can appear = 6 x 5 x 4 x 5 x 6 = 3600 Permutations and Combinations

25 Permutations and Combinations
Summary These slides focus on the approaches to doing Permutations and Combinations and their differences Permutations and Combinations


Download ppt "Permutations and Combinations"

Similar presentations


Ads by Google