 Hi, I'm Zor. Welcome to Unisor Education. This lecture is a continuation of the topics called combinatorics, and it's about permutation of the set of objects, some of them might be identical. Now, this lecture is part of the whole course, which can be found on Unisor.com together with notes for this lecture and some exercises, etc. So I do recommend you to go to Unisor.com to work with this educational material. Okay, permutation with identical objects. Well, first of all, let me just very briefly recall what is a permutation of the set of different objects. Well, as you remember, if you have a certain number n of different objects, and we would like to put them in certain order, well, the question is how many times, how many different orderings exist. Well, for the first place, we have n different choices. We can take object number, as object number one, any one of the given n objects. But for the object number two, we have only n minus one objects remaining, because one is already taken. So I have to multiply it by n minus one, if I would like to find out how many different pairs, number one and number two. And then number three comes along, and this is this, etc., etc., up to the remaining only one object for object number n. So the whole thing actually is n factorial, different orderings of different n different objects. But what if some of our objects are the same? Well, here is an example. For instance, you have a set of objects, let's say, three letters A, A and B. So two letters are identical. Now, question is how many different permutations exist of this particular set. And I'm talking about permutations of three different, of three letters. Well, letter B can be on the first place, and then there is no other choice but putting A and A. Letter B can be on the second place, and this is the combination. There are no others with B's in the second place. And finally, B can be on the third place as object number three, and that would be the combination number three. There are no other combinations. Now, if our objects were different, three different objects, I would have three factorial, which is three times two times one, which is six different combinations, different orderings. But if some of the objects are the same, I have significantly smaller number of different combinations. Now, why? Let's just think about it. Well, the answer is quite simple, and to illustrate it, let me just do it with a slight twist. Now, I will still have A, A and B, but I will put indices here. A1 and A2. A1 and A2 are indistinguishable from each other. I just put these indices to distinguish them on the board to explain what I exactly mean. Now, each combination can be either A1, A2, or A2, A1. Now, they are indistinguishable, and that's why I initially put only one combination, BAA. But if these are all different, that will be different combinations. So, these two combinations are actually good together into one when we are changing places among the identical objects, because they are indistinguishable. So, these two combinations are exactly the same from the visual perspective. This is letter A and A, and this is A and A. It's just two different letters A, but we do not know this since we do not really have any distinguished characteristics between A1 and A2. Now, same thing here. It can be A1, A2, or it can be A2, A1, and same here. Now, I have six combinations, exactly what I really needed. But, again, out of these six combinations, these pairs are constituting exactly the same permutations of initial characters, because this is BAA and this is BAA. So, my point is that if you take all the combinations where identical objects are on the same places, in this case it's this pair of combinations, or this pair of combinations, or this pair of combinations. So, within each pair, my identical objects are exactly on the same places where they are. This is number 2, number 3, and this is number 2, number 3. This is number 1 and number 3. This is number 1 and number 3. And this is 1 and 2, and this is 1 and 2, the places. so if you will take as a group so this is a group of combinations and this is a group of combinations so each group is actually a one permutation so even if you have six different permutations if you are in this if you if you put indexes for identical objects in reality since we can group them together where like objects identical objects are exactly on the same places and all these elements within the group are indistinguishable from each other they constitute one particular permutation now the question is how many elements are in the group well let's just think about it this group contains all the different permutations where a and a are standing on places number 2 and 3 and I can change within this group my identical object any way I would like and I will get all the elements from this group now if I had for instance more elements I would have more identical elements I would have more elements within the same group but in any case the number of elements within the group is equal to the number of permutations of only like objects only identical objects because if I have let's say one particular combination then I'm changing the order of these identical objects I still have exactly the element of the same group right so no matter how I change the order of identical objects within the places where they are my permutation is actually the same because these elements are indistinguishable so what I would like to say is that each group contains exactly as many elements as number of permutations within the identical object so if my identical objects are numbered to and the number of permutations is to a 1 a 2 or a 2 a 1 right to factorial is to so what I mean is that if my number of permutations only within the repeating only within the identical objects is certain number like in this case it's to I have to divide the total number of theoretically possible permutations if all objects are different I have to divide it by the number of permutations within the identical group because every permutation within the identical group produces the element within the same group of indistinguishable permutations so that's the that's the very important top now let me just make one step into a little bit more complicated area in this example we had only one group of characters a and a which is which is identical now what if we have two different groups well example for instance is a a b b b and see and let's say I'm talking about the permutations of this group of how many six characters same thing if I will index them so they look differently but in reality a 1 and a 2 are indistinguishable and b 1 b 2 and b 3 are indistinguishable what I can say is that out of six factorial of different permutations I have to divide this by number of permutations of the group of two and number of permutations group of three why because if you will take let's say let's take any one particular permutation a 1 a 2 b 1 b 2 b 3 and see and now I will repeat it but change the order of this let's say b 2 b 1 b 3 c these are indistinguishable so these are the same permutation so how many times I can just write down all these permutations which are really indistinguishable well three factorial times right and then with each of these I can change the order of these and how many of these different orders are two factorial right so in this case I have to divide 6 factorial by 2 factorial and 3 factorial because I can I can change the order within this group and change the order within that group and all of these are constituting exactly the same permutation of the entire set of six characters now let's go into a little bit more complicated case let's go back to only one group of identical characters and but in this case we will consider there are many of them so I'll use the indices so x1 and x2 etc and xn are exactly the same object these are indistinguishable I'm just using index to show the point which I would like and then you have different characters a b c whatever so if you have this particular case so all x's are indistinguishable and then all different characters you have and let's say again you have number n of all characters now obviously if I consider them different I would say n factorial right this is the number of permutations if all characters are different but now let's think about if I have one particular permutation let's say this one then down below I can put different permutation within this group only I can put x2 x1 for instance xn a b c and it will be exactly the same permutation of the entire set and then I can change again the order and again and how many times I can change the order well n factorial small n factorial right because this is the number of different permutations of this particular set of identical characters so any permutation which is different only within this group of first and and objects is only one permutation of the entire real indistinguishable permutation of the entire set right so if I would like to know how many really real permutations of the entire set I have to divide n factorial to n small factorial alright now let's switch to two groups let's say you have n1 of axis and then n2 of y's and then a b c what happens here same thing we already covered this but in the case of it like two and three if you have n1 identical objects of one kind and two identical objects of another kind and then all other objects are different then n factorial should be divided by number of permutations of the first group and number of permutations of the second group why because again exactly the same thing if you write any permutation of the entire group if you consider these characters different and then you start changing only within this group you will still have exactly the same real permutation of the entire thing because these objects are indistinguishable so all these which are different only within the order of axis should be considered as one permutation and now you can also change the order of y's and that would also be exactly the same permutation and each of these goes with each of that that's why we're multiplying them so I basically came to general formula for the following case if you have n objects and out of them you have n1 objects of one kind one type and then n2 of another type identical within itself and then n3 etc. and k then the total number of permutations of this group is n factorial divided by these by the product of these factorials because again as soon as you write any particular permutation of the entire group you can change the order within the first group anytime you want and there are n1 factorial different things and you still get exactly the same permutation of the of the entire set and for each of these you can actually multiply it you can change the order of the second group only within the group and again there are so many different n2 factorial different permutations within the second group of identical characters so basically that's what that that's the formula which you will come up with I have explained this formula I didn't really prove it it can be proven by induction let's say by the number of group k something like this and then another interesting thing what if I will consider all these different elements as groups of identical elements but the n would be n k or whatever and n3 in this case is equal to 1 so it's a group of one element right would the formula be still valid well obviously because if it's a group of one element one factorial is still one so it doesn't really matter whether you put these ones or not so if you have single different objects within the set you can still consider them as elements of the of the groups but the groups contain only one element and the formula is still valid so you can say that if you can divide your total number of objects into into certain groups and within group you have n1 element of one kind and two elements of another kind and nk elements of the case kind kind and within the group all elements are identical then this formula actually represents the number of permutation of this group well let's check out whether this particular formula is valid for our first case you remember we had a a and b right a a and b and we had only three real permutations now in this case I have only one repeating group of repeating elements and the n1 is equal to 2 in this case this is the number of elements in the first group and the second group I can I can specify the second group is having only one element right now what our formula gives us three factorial divided by two factorial and one factorial which is six divided by two which is three which is exactly what we got so this is the correct formula now another particular example let's go into some extreme case let's say all elements are the same so what do we have in this particular case so this is the case of like this but if all elements are the same then no matter how we will change their order it's one permutation right so we should have the answer one number of permutation is equal to one if all elements are identical now in this particular case what do you have you have n is equal to whatever it's equal to now n1 would be equal to n right this is the size of the group and they're all identical right so the size is the entire set and there are no in 2 and 2 and 3 and nk etc so this is all out and n1 is equal to n so you have n factorial divided by n factorial and you have one so the formula again holds and another extreme case when all elements are different so we have n groups so in this case k is equal to n this is number of groups and each group and either has only one element because all elements are different right so each group contains only one element so in this particular case what do we have here well we have n factorial divided by one factorial one factorial one factorial these are all ones so we have n factorial and this is the original formula for the number of permutations so what's the most important lesson which you can get from from this particular lecture if you have certain number of elements identical in the set and you're looking for permutations obviously if you will permute only the elements within that set then the permutation of the entire set remains looking exactly the same so if you change the order a and a the permutation would be exactly the same so that's why we are dividing the total number of permutation which is n factorial into the number of permutations within that one group and if you have more than one group you have to divide it by another factorial another number of permutations within the second group well depending on how many elements are there etc so that's the most important lesson you have to divide by permutations within each repeating group okay that's it that's all I wanted to talk about today it might be slightly more difficult than the previous lectures about permutations but I hope I explained it well and there are different problems which will obviously use this particular property of repeated objects of identical objects and their permutations always go to Unisort.com if you would like to engage in the whole educational process because it contains the course and register students can take exams etc so I do encourage you to go to the website rather than just watching this particular lecture on YouTube that's it thank you very much and good luck