 Hi, I'm Zor. Welcome to Unizor Education. Today's topic is combinatorics, problems related to combinations, relatively simple problems. As usually, I do recommend you to do all these problems yourself first. And you have to go to Unizor.com, where this lecture is presented. Try to do it yourself, and there are actually solutions there as well. So, you might read it afterwards and then listen to the lecture, just to compare your thoughts against whatever I'm presenting. You might actually get some better solution or whatever. Alright, so, problems. Problem number one. Okay, imagine you're playing bridge. The card game bridge, I mean. You have 52 cards in the deck, and they are dealt among four players. Each one gets 13 cards in the beginning. So, you are the player, so you get your 13 cards. Question is, how many different sets of 13 cards you can get? This is usually called the hands. So, how many different hands you can get after the dealer deals the cards among four players? So, I'm talking about only one particular player, you. So, how many different hands you can get out of 52 cards with your 13? Well, this is a very typical and very basic problem on combinations, because you don't really care about the order of these 13 cards, right? And you don't really care about distribution of these 13 cards among other players. So, basically what I would like to say is, and we are not using any formulas. We are basically deriving the formula on the fly. So, the only formula which you probably have to remember is the number of permutations. So, you have 52 cards, so you can put it in 52 factorial different orders. Well, 52 places for the card number one, 52 choices actually. 51 choices for card number two, 50 for card number three, et cetera, et cetera, down to the one choice for the 52nd card. So, that brings it to 52 factorial, the product of all numbers from 1 to 52. Now, are all these permutations of 52 cards give you different hands? Well, obviously not, because the way to do it is, let's put these 52 cards in the deck one after another, and let's say you have the first 13 card. It doesn't really matter how it's dealt. Actually, it's dealt one by one, so you get every fourth one, but it doesn't really matter. You get a specific 13 cards out of this 52. So, let's assume it's the first 13. Now, any permutation within this 13 gives you exactly the same hand. You don't really care in which order you get these cards, as long as you get exactly these cards. Similarly, any permutation among these, the rest among the other players, you don't care about. So, again, this is 30 factorial permutations, and this is 39 factorial permutations. So, you don't care about these, and with each of them you don't care about those. So, basically what I would like to say is that initial 52 factorial should be divided by 13 factorial and 39 factorial, because these gives you exactly the same hand. And that's the answer, which happens to be, obviously, the number of combinations from 52 to 13. Or sometimes they write it this way, sometimes they write it this way. Whatever the way they write it, that's why I prefer maybe something very simple, which is this. Okay, this is number of combinations of 13 cards out of 52. Now, problem number two. Imagine exactly the same situation. But now, not only you are interested in whatever the hand you get after the dealing, but every other person as well. So, basically after all 52 cards are dealt, every one of four players has some hand. So, now question is, we are dealing with some kind of a distribution of 52 cards among four different players, 13 each. How many different distributions, how many different combinations of the game are possible in this particular case? Okay, I will actually present you two different solutions. And hopefully they will get exactly the same result. All right, solution number one. Let's do exactly the same as we did in the first problem. So, let's care about the first hand. So, the first player will have that number of different hands. After 13 cards are already chosen for the first player, there are 39 remaining cards which are distributed among the three other players. So, the player number one will have very similarly exactly the same considerations. He will have 13 cards picked out of 39 remaining, right? After 13 out of 52, we took out for the first guy, there are 39 remaining. And out of these 39 remaining, we have 13 chosen for the player number two. Now, the player number three will obviously get 26, 13. Because after we out of 39 cards will already give to the player number two, we get 13, we have 26 left. And then finally, out of the rest 13, we get 13 for the fourth one, right? Which is actually not a big choice because there is nothing left but these 13. So, in theory this should produce one, and it does actually. All right, so that's one type of calculations. Now, let's consider this problem from the other hand. We have 52 cards, and let's again use our geometric representation, 52 cards. And we divide it in four different groups, 13 cards each. Now, any distribution of these 52, and there are 52 different ways of ordering these 52 cards, gives certain distribution of the cards among the four players. All the distributions within this group of 13, so all the permutations, and all permutations of these, and all permutations within this group only, and all permutations within this group only, none of these actually changes the total distribution, because the cards will remain within the same player as they were before. So, number of these is 13 factorial. With each of them we can have as many permutations of this guy, which is also 13 factorial, and this 13 factorial, and this 13 factorial. So, we have to multiply them all together because all of them give exactly permutations within each one of these groups, gives exactly the same thing. So, we have to divide it by 13 factorial, and 13 factorial, and 13 factorial, and 13 factorial, right? So, it's 52 factorial divided by 13 factorial power of 4. So, that's another way to approach it. Well, let's check if they are the same. Okay, I don't remember the formula, but I already so many times derived it that I remember it now by now. So, it's 52 factorial divided by 13 factorial, and 52 minus 13, which is 39 factorial. Now, this is 52, sorry, 39 factorial divided by 13 factorial and 26 factorial. This is 26 factorial divided by 13 factorial and 13 factorial, and the last one is 13 factorial divided by 13 factorial and 0 factorial, right? 0 factorial is 1. So, what do we have remaining? We have 52, we have 52 factorial, 13, 13, 13, 13, 4 times exactly the same as this one, right? So, we got the same answer. You can choose any solution you would like. Personally, I prefer the second one because it has this geometric representation. So, to count how many different distributions are among four players, you put all the cards in some order and draw 52 factorial, and then you permute everything which doesn't really change the whole distribution. So, within each player, 13 factorial permutations must be counted as 1. And the same thing for the second one and the third and the fourth. Okay. Let's go on. Let's consider you have a keyboard menu. Keyboard... to the computer keyboard. I mean a computer keyboard, right? Computer keyboard. And it has different keys which have functional, actually, functionality. Right. What I mean is there is a control key, remember this. There is an alt key. There is a function key. There is a shift key. And there is something else, because I remember 5, menu key. Some kind of menu key. On Microsoft, there is some kind of a Microsoft running operating system. There is a key which has this Microsoft logo, for instance. So, we have five different functional keys. Their purpose is not to enter some, like, digit or a letter or something like this, but some functional purpose. Now, you probably know from, again, usage of the personal computers for Microsoft operating system, you have to press control, alt, delete, for instance, to reboot the machine, right? Or something like this. Or get to the main menu, whatever. So, you have to press three buttons. So, my task is, I have five different function keys. Now, if I'm using a combination of simultaneous pressing of three of these keys, how many different functions I can accomplish? So, control, alt, delete is one. Control, menu, funk is another. Funk, shift, alt is another, etc. So, how many different combinations of three keys simultaneously pressed I can get from these five functional keys? Well, this is, again, a typical problem related to combinations. I have five choices and they have to pick three of them. So, it's number of combinations of three out of five. Again, how can we basically derive this? Very simply, we have five. And let's say you put them in the order and you cut it the first three in the beginning. So, how many different sets of the first three you can get? Well, obviously, the five factorial is the total number, right? But, since these can be permuted in any order and they actually constitute exactly the same combination of three keys, I have to divide it by three factorial and then I have to divide it by two factorial because any permutation of these, which I'm not using, also constitute exactly the same set of three keys at the beginning, right? So, that's the answer, which is exactly the formula for number of combinations of three out of five. Next. Next, you have a company which employs 10 managers, 30 programmers and 20 data entry operators. That's the stuff. That's what they have. This is the company. Now, there is a special project and this special project requires two managers, six programmers and four data entry operators. So, question is for this particular project, how many different teams can we construct from these employees if we need this number of specialties within this particular team? The answer is you have to pick two managers out of ten and this can be done in this number of different choices, right? Now, with each of them, you can have six out of 30 and with each of the programmers and with each of them from 20 data entry operators, we have to choose four and that's supposed to be the answer, right? Or if you wish, we can go into the factorials and they don't want actually to do it, like ten factorials divided by two factorials times eight factorials, etc., etc. So, that's the answer. Next problem. Next problem, you have five tennis players and they have to play with each other, let's say one match. So, question is how many different matches can be played? Well, again, it's a regular problem related to combinations. It's the question of how many pairs we can choose from five different objects. Because every pair constitute a match between two different tennis players and we don't really care about the sequence. If first plays with the second, then the second plays with the first at the same time and we are saying that only one match is supposed to be done. So, basically the answer is supposed to be out of five players we have to choose two. So, how many different combinations we can have? Which is actually five times four divided by this, which is ten. Now, there is another way to approach this and it's always good actually to approach the same combinatorics problem from more than one different direction. Well, the direction is the following. You can think about the first player. He can play with the second, the third, the fourth and the fifth, right? Then you can take the second player and he can play with the third, the fourth and the fifth. With the first it's already played, right? So, here you have four, here you have three. Now, the third player can have four, number four and number five players. Because all the previous one, three and two is already played, three and one is already played. So, this is two. And finally, number four plays with number five, which is only one game. And some of these gives exactly ten. Yet another approach, which is probably also very interesting, a geometrical approach. Let's position our players as a pentagon. We have five players, right? And let's connect them. So, this is a pentagon and these are diagonals, right? Here. Now, we connect it all with all. Now, how many different connections we have? We have five sides of this pentagon and five diagonals gives you ten connections, right? So, that's yet another way to approach and this is the same number. And again, it's very good actually in combinatorics to check the problem from different directions because, as I was saying before, combinatorics problems are very difficult to check. If you are solving an equation, you can have the number which is the result of your solution substituted back into the equation and either you see it's equal or not equal. I mean, identify identity or not identity. Here, you cannot really check so easily. The only way you can have is to approach the problem from a different angle. Maybe direct calculation as I did here or some other geometrical calculation, whatever. So, the more ways you can approach the problem to get the same answer, the more you are sure that the answer is correct. It's very important in combinatorics. Okay. And the last problem which I wanted to talk about is... All right. Let's say you have a fisherman which has caught ten fishes. Ten fishes. Now, we have two different scenarios. Scenario number one. He eats three fishes. One for breakfast, one for lunch, and one for dinner. Question is, how many different day meals he can have if he has ten fishes and he's using one for breakfast, one for lunch, and one for dinner? Well, the answer is obviously he has ten choices for the breakfast, right? Now, one fish is already eaten, so there are only nine left, nine choices for the lunch, and eight choices for the dinner. They have to multiply, and this is 722. So, he has 720 ways to eat three fishes during the day out of these ten. But if he doesn't want to eat these fishes, he wants to throw these three fishes back into the lake where he caught it from for whatever reason. Well, this is different because in this case the order is important. In the case when he throws away, it doesn't really matter which fish is the first, which fish is the second, and which is the third, which he picks for throwing away, which means in this case, in case when he throws away, he actually has a number of combinations of three out of ten, which is ten times nine times eight divided by one, two, and three, which is 120. So, this is the number of ways he can pick three fishes and throw them away. And this is the number of ways he can pick three fishes for breakfast, lunch, and dinner separately. And the difference is only because this is an ordered set and this is not. This is basically a partial permutation and this is the combinations. Okay, this is it. That's all my six problems I wanted to present to you today. Suggest you to go back to Unisoner.com and go through these problems by yourself. Don't look at the solutions and try to refresh your memory to come up with the same solutions. Thank you very much and good luck.