 Hi, I'm Zor. Welcome to Unisor Education. We will continue talking about combinatorics and today's topic is combinations. I do encourage you actually to watch all these lectures on Unisor.com website, not just on YouTube, because there are notes for the lecture which you can follow and then you can actually get involved in an educational process by signing on, taking exams, etc, etc. Alright, so, combinations. We have already talked about partial permutations. It's one of the previous lectures about combinatorics. Now, partial permutations, let me just remind you, is when you have n different objects, we are talking about different objects only, you have n different objects, you have to pick k out of these n and put them in certain order. Now, just as an example, let's just consider the following five objects. Let's say you have a cube, you have a house, country, a book, and pen. And you are interested in picking two objects out of these five. Well, you can always have a combination, let's say, cube and country. You can always choose country and cube. And these are two different partial permutations because there is different order of these two. Same thing, you can choose, let's say, house and country, and you can choose country and house. And these are two different permutations, partial permutations. Now, this is the case of partial permutations. Now, we do remember actually the formula for this. The partial permutations of you have a total of n objects and you are picking k it's equal to m factorial divided by m minus k factorial. And obviously you can refresh it by going into the previous lecture where I'm explaining this formula. Now, what's the difference between partial permutation and combination? One very important and very really small difference. We don't care about the order in combinations. So these two actually represent the same combination. And any other pair of these two objects if we don't care about their order it represents a combination. Basically the combination is a subset. That's what it is. So let's just count how many combinations we have out of these five objects by two. That's actually explicitly we will count them all. Well, on the first place we can have cube and on the second place we can choose house. Then with the cube we can have a country or we can have a cube with a book. We can have a cube with a pen. Now, with the house we don't count house and the cube because we already counted cube and house and we are talking that we don't care about order. So this combination of house and cube is already covered. So we have to go forward. So it's house and country house and book and pen. And then with the country we already counted the previous one. Country and cube, country and house. So we have to count country and book and country and pen. And the only combination left is book and pen. No other combinations. We have one, two, three, four, five, six, seven, eight, nine, ten. We have ten combinations of two objects out of five given. So this is an example of what I mean combination. Combination is basically a subset. And the house pen subset is no different than pen house subset. That's why we counted it only once. Now, let's just think about how we can calculate how many different combinations exist. Well, let's just forget for a second this particular example. Just remember we have ten because in the future we will have to check this against the formula. So let's go back to our formula for permutations, partial permutations. So this gives us the number of partial permutations where we do care about the order. But let's just think about if you have certain subset of a set and then you change the order within this subset only it will be different partial permutation obviously, right? But from the combination standpoint when we don't care actually about the order it will be the same combination. So let's say book, country, and pen and book, pen, and country etc. All other permutations they constitute exactly the same combination. Different partial permutations but the same combination. Now how many of these different partial permutations are supposed to be composed into one combination? Well the number is as many permutations within this subset we have, right? So if this is a subset of the three elements we will have three factorial different permutations which we have to count actually as one. Which means that the total number of partial permutations will be reduced by the factorial of this set which is K factorial. Remember K is the number of elements in a partial permutation, right? So if we will divide it by K factorial we will reduce the number of partial permutations to the number of combinations because K factorial of partial permutations always constitute one particular combination. K factorial of these different partial permutations are all the different ordering of whatever the subset we chose which contains K element. It's still the same combination. So if I would like to go into the combination what I have to do is I have to take the number of partial permutations and divide it by K factorial. So if we have a set of all the different partial combinations we group this set and each group contains only the different permutations within the subset. It constitutes one combination then another group would be the group which contains different elements in the subset but positioned in many different orders and we are interested in all these permutations which are differ only by the order within this subset and again it's K factorial. So if you have all the permutations, partial permutations of let's say two objects out of five then we group them together. These are all permutations which have the same subset but in different orders and this is exactly all the permutations of the same subset in different order. So it's different subsets but within this group we always have K factorial different permutations which means we have to divide by K factorial the number of total of partial permutations to get the number of subsets, get the number of combinations. So that's the formula basically. Derived reasonably logically. I'm not saying this is the proof, again if you want to have a proof you probably will have to do it by induction. I don't think it makes any sense because we did it once for permutations and all others are more or less equivalent. But you have to feel that this is the right formula and let me explicitly put it in this notation. So it's M factorial divided by K factorial and M minus K factorial. So that's the formula for a number of combinations. Okay now before going any further I don't know about you but personally I was just thinking well we actually heavily rely on the formula for partial permutations which is not a simple formula. I would say that formula for regular permutations, the permutations of N objects, N factorial. It's simple and the logic for this is really very very straight forward. You have N different variations and different choices for number one and N minus one choices for number two etc. down to the one last object so that gives you N times N minus one times N minus two etc. which is N factorial. So this is a simple formula. Formula for partial permutations is slightly more complex and it involves a little bit more logic to derive it. So maybe our reliance on this formula is a little bit artificial. Now for those who feel that there is some artificial dealings about using this particular formula, let me try to derive the same formula differently. More logically I would say and I will not rely on this formula more complex one. I will rely on this formula, the permutations of the original set. Now and here is another logical explanation of why this formula is correct. Let's imagine that we have to choose a subset using the following logic. Let's say these are our objects. We put these objects into certain order. Order is important now. Now let's say we have one, two, three, four, five, six objects and we want a subset of two objects. So we want to know number of combinations of two out of six. So what I do is I put them in order and separate them into pieces. Two on the left and well in this case four on the right. So if I have n objects I have k here and n minus k here. k is number of elements number of objects in our subset. The number of objects in the combination we are interested. So the way how I choose my particular subset is the following. I put all my objects in a row. Basically order them and then cut the k from the beginning. Whatever is on the left I choose as a subset. Whatever remains I don't care. So that's how I choose the subset. Then I can change the order of these objects and again cut it after the number k and whatever is on the left is my subset. Now what's right and what's wrong about this approach? Well right is that every time we get some subset. What's wrong about this is that sometimes we can get exactly the same subset because if I will call this object an a and this object a b and then whatever the rest is and then another b a and then whatever is left represents exactly the same combination. So how many times I counted the same combination of a and b if I'm using the process I was just explaining? Well it's very easy to count. Basically all these permutations within the left part do not produce different subset. They produce exactly the same. What's more if I'm changing the places only within the right part within the tail of this sequence I also don't really change whatever is on the left. So out of all the permutations which I have and I have n factorial obviously of all permutations of the original set I have to again divide it by how many different ordered sequences produce exactly the same subset on the left. Well obviously again I have to divide by all the permutations of the left part and all the permutations of the right part because any of these permutations don't really change the composition of my subset which is on the left. Now on the left I have k factorial. On the right I have n minus k factorial different permutations so I have to divide my n factorial which is the total number of permutations by all the permutations of the left and all the permutations on the right because for each of these you have as many of those and none of them actually changes the composition. So that's the formula basically. We just derive this formula using some slightly different logical explanation in which we do not really rely on the formula for partial permutations but just the permutations. So permutations of the total I divide it by permutations of the left part and the right part and that would give me the correct number of subsets which are on the left. What's interesting by the way is that the number of subsets which I choose in this way which is on the left is exactly the same as the number of subsets which I'm choosing on the right because choosing a subset on the left automatically chooses a subset on the right. Now on the left number of combinations is this. Now how many combinations of in this case of four elements out of six or n minus k elements out of n. Well that's the n minus k. So what I'm saying is that choosing k subsets subsets of the size k the number of these subsets of the size k, number of combinations of k from n is exactly the same as number of combinations of n minus k by n. Because choosing a subset of k we automatically choose a subset of the rest of the object which is n minus k. And if you will substitute instead of k n minus k into this formula you will get exactly the same thing. If n minus it would be what? If you will choose this instead of k you will have n minus k and in case of n minus k you will have n minus n minus k. So it's plus k which is k factorial again. So it's the same formula right? So it's very interesting actually. So the combination is kind of symmetrical. Choosing a combination of k automatically chooses the combination of n minus k. Now notation you see I was just using the most primitive notation which is this. There are many different notations for the number of combinations and they are this, this nobody knows what's exactly the right thing because different people do it differently. You have this or this. So whatever it is. Now what is the most important sign by which you can basically distinguish which of them is the number of total number of objects and which one is the subset? Well obviously subset is smaller or at least not bigger. So if you have one of the numbers smaller than another so that means that the bigger number represents the total number of objects and the smaller number represents the number of objects in the subset. So that's as far as the symbolics are concerned. Now let's consider a few trivial cases and you know what after you have derived certain formula like in this case we have this formula it's very important to make sure that the formula makes sense. So the question is does our formula make sense? Well let's just check it in a few simple cases. Case number one, k is equal to n. Now what does it mean? So I'm choosing a subset of n objects out of n different objects. How many times I can do it? Well obviously there is only one way, there is only one subset which is a full set. Now this formula is supposed to give me one. Well let's just check. I have n factorial divided by n factorial divided by n minus n factorial. Well n minus n is zero and you remember from the previous lecture I was talking about zero factorial that it's equal to one by definition. So we get n factorial divided by n factorial which is one which is exactly how our intuition basically tells us supposed to be. Another variant what if k is equal to one? So I'm picking only one object out of n. How many different combinations of one objects out of n exist? Obviously n. Well let's just check the formula we have n factorial divided by 1 factorial and n minus 1 factorial. Now what is this? 1 factorial is one. Now n minus 1 factorial is the product of all numbers from 1 to n minus 1. This however is the product of all numbers from 1 to n. So first it goes from 1 to n minus 1 and it will cancel these guys and the only one which is remaining is this. So these are all cancelled out and only n remains. So for k is equal to one our intuition tells it should be n and the formula gives exactly this. Now the third case k is equal to zero. What does it mean? Well it means we want an empty subset. Remember what empty subset is. Subset which has no elements. How many empty subsets exist? Only one. There is only one empty subset in the universe. There are no more empty subsets. So we always can have that the answer is supposed to be equal to one empty subset. Well let's just check. It's n factorial divided by zero factorial and n factorial. So again zero factorial is one. So the result is one as it's supposed to be. And the last example which I would like to make is I would like to recall my initial example of five objects. Cube house country book and pen and I was choosing two and I basically listed all different combinations of two objects out of these five and I counted ten different combinations. Now let's check it out. Five objects, two in a group. So it's five factorial divided by two factorial and five minus two three factorial which is equal to. Now what is five factorial? It's one times two times three times four times five. It's two, six, 24, 120 divided by two factorial which is one times two which is two. Three factorial one, two and three which is six. 120 divided by 12 which is ten. Exactly what we have to do. Well again this is not a proof obviously of the correctness of the formula. It's just to make sure that whatever you do makes sense. Well that's it for today. This is just an introduction into what actually the combinations are. Don't forget it's formula, it's properties. Well speaking about don't forget the formula disregard what I just said. You can forget the formula. As long as you remember the logic when I was just talking about you have a certain number of objects put into certain order you separate k from n minus k and you're saying that basically the total number of permutations which is n factorial which you actually probably remember anyway. Should be divided by k factorial and n minus k factorial to get to the number of combinations because all these permutations within this group or within that group really produce exactly the same subset. So that's how you don't have to really remember the formula. You just have to think about logically deriving this formula from this particular process. Put it in a row, cut it whatever the first k is and then just count the permutations left part, right part and the total. Okay, so that's it for today. I do encourage you to use the Unisor.com as an educational site where you can establish the whole educational process with a supervisor or a parent who can enroll you and you can go through exams and all that stuff. Alright that's it. Thank you very much and good luck.