Transcript for:
Understanding Permutations and Combinations

in our last video we took a look at some basic counting rules and we're going to take it just a step further in this video talking about permutations and combinations when we have a set number of objects and we want to group them either in a specific order or not in a specific order so that is the difference between the permutation where order makes a difference in combination where it does not after this video video 62 we are going to take a look at practice for topics learned in both video 60 which was counting rules in video 61 which is permutations and combinations we're going to start by taking a look at permutations and permutations are when we have n objects and we care about the order in which we arrange them so it's an ordered arrangement of distinct objects so for instance if I have three objects I could arrange all three of them but typically what they're going to say is we have and the amount of objects and we want you to take K at a time so using this notation we're going to talk about the P in a moment but it's going to look like this or some textbooks might use an R instead of a K but it's really the same idea but typically it's going to be an R or okay you might also see it written like and P R or n PK and that means the same thing as well where the N and the K or the end and the r are actually subscripts you might also have a button in your calculator or a menu option in your calculator that will calculate this for you but let's go ahead and talk about what we mean by this before we talk about our formula for this what we have here is we have three objects a B and C and we're looking for the number of ways that we could arrange these where our order makes a difference so for instance if I wanted to look at all two permutations of set s I could have a B or I could start with a and end with C so I'm using two objects at a time or I could start with B and end in a or I could start with B and end in C or I could start with C and end in a and I could start with C and N and B so as we can see there are six options so the number of elements in that set is six now we could also think of this using the counting rules we just learned and say well there's this is a multiplication rule question I am going to take two objects the first object I have three options for a B or C the second object have only two options for because I've already used one in the first space and three times two is six so now we can see that our answer is six and we verified at two different ways but we want to take a look at our formula so I want to talk to you about where this formula comes from so the formula itself and I'm just going to use N and K again it doesn't matter if you use R or K the formula itself is n factorial over N minus K factorial now we're going to use that in a moment to verify what we've learned about six twice but before we do that let's take a look at why this works so if I take a look at n factorial n factorial means take n times n minus one and if you'll recall factorial just means take it times every integer all the way down to one so n minus two and I would continue this pattern and somewhere in the middle I would be multiplying by n minus K minus one and then times n minus K and then times n minus k plus one and I would continue times 2 times 1 and then my denominator would start at n minus K and then it would be n minus k plus 1 and minus k plus 2 etc down 2 times 2 times 1 because that's what factorials do now I can see that the N minus K will cancel and the N minus K plus 1 and everything all the way down to the end which leaves me with just this so before I actually use that formula let's talk about what I've outlined here in yellow as it relates to the second way I solved this problem this tells me I'm going to start multiplying by n which is 3 which is what I did and then I'm going to multiply over times - one which is what I did three minus one is two so I'm going to continue this pattern until I get to this object and this object is n minus K minus one so in my question n was three and K was two so here I would take 2 minus 1 which is 1 and I would take 3 minus 1 which is 2 and so that tells me that 2 is the last number I'm multiplying buddy and that's exactly what I did so this that I have here in yellow verifies how I did this by hand so now let's take a look at using the actual formula the actual formula would be P 3 comma 2 and that would say let's take 3 factorial over 3 minus 2 factorial so 3 factorial which is 3 times 2 times 1 over 3 minus 2 or 1 factorial which is 1 and I end up with 3 times 2 which is 6 so that is how we find a permutation hopefully the way we developed that formula made sense but here is the takeaway this is your formula let's take a look now at combinations and combinations are related to permutations the difference here is that we do not care about the order so if you'll notice in our last example we use the exact same set s containing elements ABC and when we found the permutations we said we could have a B or a C we could have BA or BC and we could have CA or we could have CB and the reason I've obviously written them written them in this way is because a B and BA are really the same set if order doesn't matter and AC and CA are the same set in BC and CB are the same set again so when we had permutations we had 6 but now the number of combinations is three so I had to take six divided by two to get to three now how do I know what to divide by it well that's what we're going to talk about so again combinations we're going to end up dividing by some number so that we take out any of the redundancies so if you'll recall what we did previously when we had a permutation and choose R and I'm going to use R here just because I have our combination permutation of n choose R was n factorial divided by n minus R factorial again sometimes you'll see it with K sometimes with our now I want to look at what happens for a combination where order doesn't matter it's still going to look the same and I'll say again it might say n see our I know in the ti-84 that is the way that you're going to see it same idea I'm going to take n factorial n minus R factorial which of course represents the number of permutations then I'm also going to divide by our factorial now what this value does dividing by r factorial is finding this number that I need to divide by to take out any of the redundancies because for a permutation we count all of the different ways that it could happen for a combination we essentially take out anything that is redundant anything that has the exact same two or three or however many values we need so we're going to divide by R or K if you're using K instead of R so let's take a look at how that looks for this question if I need to find the number of combinations of three objects and I'm choosing two then I'm going to take three factorial divided by 3 minus 1 sorry 3 minus 2 factorial divided by 2 factorial so 3 factorial is 3 times 2 times 1 3 minus 2 is 1 factorial 2 factorial is 2 times 1 and I can see that I end up with 3 over 1 which just three so again that is how you do it you're going to take the number of permutations and also divide it by our or K factorial I want to look at two practice questions with you for a permutation and a combination question and we're going to talk about which is which but keep in mind that the entire next video is all practice for permutations and combinations but looking at this first question it says how many poker hands of five cards can be dealt from a standard deck of 52 parts so I have 52 distinct objects and I am choosing five of them so those are the two numbers so the question is is this a P 52 5 or is this AC of 52 5 and of course the difference between them is do we care about the order or doing that care about the order well because I'm just getting a deck of cards I'm not going to care if I get the King of Hearts first or the King of Hearts last I just care that I have it in my hand so I don't care about the order in which I am dealt the cards I just care about the cards that I have so I'm going to choose the number of combinations now again if I wanted to brute force this I would say well my first card I have 52 options and then I have 51 options and then I have 50 options and then I have 49 options and then I have 48 options but that doesn't take into account all of the duplicates and that's why we're choosing this C so instead of brute forcing I'm going to just use my formula and my formula for C and choose K was n factorial n minus K factorial K factorial so if I'm finding the number of combinations oops of 52 objects and I'm choosing five at a time that would be 52 factorial divided by 52 minus 5 factorial divided by 5 factorial now keep in mind that what would happen in the numerator would be 52 51 50 49 48 and 47 all the way down to 1 and I stopped at 47 because 52 minus 5 is 47 and then I would have five factorial so five tonnes whoops four times three times two times one and the cancellation that would happen is the 47 factorial so I have these objects on the top which is what we talked about before 52 51 50 49 and 48 and the 5 times 4 times 3 times 2 times 1 represents all the redundancies so again I would not be listing these out I would probably just put this into my calculator but we need to know how to do this by hand as well because if you're one of my students you know I want to see your work so I would then take the numerator divided by the denominator and the numerator is three one one eight seven five two zero zero my denominator five times four times three times two times one is 120 and then I end up I'm going to just get rid of my formula because they don't have room for it anymore I end up with two million five hundred ninety-eight thousand nine hundred sixty different poker hands now let's take a look at another question now obviously my first one I used combination so my second one I'm probably going to use permutations its permutation and choose K is n factorial over N o n minus K factorial so in this case I've got one hundred marathon runners finishing in first second third place so obviously that is why order makes a difference because I would rather get first place in third place and so all of those values are different now this one we could route for so we could say there's 100 people who could get first place only 99 who could get second and 98 who could get third or again I can use my permutation formula 100 choose three because I'm choosing per second in third place three places which is 100 factorial divided by 100 minus three factorial and again this works because this would be one times 99 ahead of myself since 99 times 98 times 97 factorial the denominator would be 97 factorial and those would cancel out and I would end up with exactly what I had here which if I multiply that out is nine seven zero two zero zero so nine hundred seventy thousand two hundred ways coming up next we're just going to take a look at a bunch of different questions that have to do with all of the counting rules and permutations and combinations that we've learned