 Hi, I'm Zor. Welcome to Unisor Education. We are continuing solving combinatorics problems. As usually, I encourage you to go straight to the Unisor.com website where this lecture is presented with nodes and solutions. Now in the nodes, I not only specify the problem itself, but also I first write the answer. So it would be great if you can just try to solve this problem yourself and then check it against the answer which I have there. Well, if it's the same answer, that's great. Then you can just either read the nodes where my logic is explained or listen to the lecture or both. But what's very important is to try to do it yourself first. So that's my usual encouragement for all the problems. Try to do it yourself because that's the only purpose. You have to do it yourself. Now, for one purpose, as far as I understand, the more problems, even if you don't solve it yourself but you try, and the more problems I explain the solutions, the better chances are that all this methodology can be used by you for new problems. Right? So that's what we are doing. Now, today's problems, four problems, let me just start one by one. Okay, number one we have. Okay, we have two N different objects and we would like to break them into N pairs. So question is how many different ways are there to break these two N objects into N pairs? And I do not differentiate the pairs like object A and object B. This is the same pair as B and A. So pair is not ordered pair, it's just a pair. So question is how many different ways of dividing these two N elements into N objects into N pairs? Now, let's think about it this way. If I will put all these two N elements into one row in some sequence, in some order, then I just separate them into pairs by basically having number one and number two. This is the one pair, number three and four is another pair, four and five, third pair, etc., etc. Now, well, obviously we do have some kind of distribution of my two N objects into pairs. Now, if I will permute all these objects in this particular order and put it in some other order, I will definitely have different distribution. Well, but is it really different? If I will have a permutation where only these two objects, for instance, are exchanged places, then I basically have exactly the same distribution of my two N objects into pairs, right? So somehow I have to account that not all permutations of two N objects produce different distributions. And by the way, there are two N factorial of these different permutations, as we know, right? So some of them are really producing exactly the same distribution of pairs. Now, which ones? Well, all the permutations where I can change these two places and this is two, number one, number two, or number two, number one. Now, with each of them, I can have these in different order and it still is the same distribution by pairs. So it's another two and then another two. And how many pairs are there? Well, that's how many times I have to multiply by two, right? Well, sorry, not multiply, divide obviously. And this is two to the power of N. Now, I'm dividing because I'm reducing the number of different distributions of my two N objects into N pairs. So that's why I have divided by two. If I take into consideration that I can reverse this order, I can reverse this order, etc., and there are N different pairs. So N different times I have to multiply two by two by two by two to factor down my total number of distributions. So that's the answer. Okay, next. Next is I have three points A, B and C on the plane. Now, through point A, I have X different lines. Through point B, I have Y different lines. And through point C, I have Z straight lines. Now, let's assume that there are no parallel lines among all these X plus Y plus Z lines. There are no parallel lines. And let's also assume that if you consider the intersections between the lines, no point exists. Well, except these A, B and C, of course, no point exists where three lines are intersecting in the same point, right? So if I have any two lines outside of these A, B and C, they intersect because they're not parallel, as I said. And the point of intersection is the point of intersection of only these two lines and none other. Alright, so now question is how many triangles are formed by these particular lines? Okay, so that's the question. Now, let's think about how these triangles can be formed. Well, one way to form these triangles is to have one line from each group, one from X, one from Y, and one from Z. And obviously, these three lines form a triangle because none of the lines are parallel, right? So how many choices do I have if I would like to count only triangles built from the lines belonging to three different groups? Well, obviously, X choices for the first line times Y choices for the second line and times Z choices for the third line. So if I'm counting only triangles built from all different groups, it's X times Y times Z, right? So that's the number of triangles which are built from lines belonging to different groups. But it can be slightly different. I can have two lines of one particular group and one of the lines of two other groups. And that's also a triangle, right? Because these two are not parallel and one of these, one of these or one of these, they're also non-parallel. And obviously, they will form a triangle. Now, there are three actually different ways. I can take two lines from group A and then any of these, any one of these and any one of these. I can have two of these and any one of these two or I can have two of these and any one of these. So what is the total number of such triangles? Well, let's just consider how many choices of a pair of lines here I have. Well, if altogether I have X different lines and I need to pick two, that's C number of combinations from X by two. Now, so I have a pair. Now, this pair can be combined with either these or these, one line out of these. How many of these are Y plus Z, right? So I have to multiply it by Y plus Z. So that's the number of triangles formed by a pair of here and one of these. Now, I have to add to this, obviously. Similarly, a pair of these, which is C of Y by two times some of these two, Z plus X plus. I can take number of combinations of two lines out of Z and one of these, which is X plus Y. So if I will sum up all these and this, that's the total number of triangles which can be formed by all these lines. That's it. Now, by the way, I did not mention it before, but if you come up with some different logic, different way to come up with the same number, by all means send it to me and I will put it on the web with reference to your name if you want to. All right, next. All right, I have six digits. One, two, three, four, five and six. Now, out of these six digits, I form different numbers and the condition is that the number should contain all these six. So there are no two identical digits. So which numbers I can put up? One hundred and twenty three thousand four hundred and fifty six or two hundred and thirty four thousand five hundred and sixty one or one hundred and fifty six thousand two hundred and thirty four, etc. The numbers which contain just exactly these six digits in some order. Well, what I would like to know is I would like to have a sum of all these numbers and draw a lot of them, right? Well, it's an interesting task and the question is how to approach it. Here's what I suggest. First of all, how many numbers exist? Well, obviously it's the number of permutations of six objects, right, which is six factorial, which is seven hundred and twenty. One times two, times three, times four, twenty four, times five, one twenty and times six. Okay, fine. Okay, so I have a column of numbers and the column contains seven hundred and twenty lines and I have to summarize them together. Well, let's continue. Let's continue each individual small column of width one. Well, I have number six, I have number one, I have number four, I have some other numbers, right? Well, the total number of numbers is seven hundred and twenty, obviously. Now, how many of them are six? How many of them are one? How many of them are four? Obviously, each digit is supposed to be repeated exactly the same number of times as the other digit, right? So, I have six digits, different digits, and I have seven hundred and twenty rows, which means that every digit occurs in one hundred and twenty different lines. So, I have one hundred and twenty times six repeated somewhere here, one hundred and twenty times one, one hundred and twenty times four, and one hundred and twenty times two and three and five or whatever else, right? So, that would make my total number of digits exactly the same for each digit and each digit appears one hundred and twenty times. So, if I will just summarize one column, the very last column, I will have one hundred and twenty times plus two one hundred and twenty times plus three one hundred and twenty times plus four one hundred and twenty plus five one hundred and twenty and plus six one hundred and twenty. Which is the same thing as one plus two plus three plus four plus five plus six times one hundred and twenty. So, that's the number which I can get if I will summarize all the digits in the first column. Now, whatever this number is, and by the way, I did calculate it in the notes for this lecture at Unisor.com, you can check what this number actually is. Now, whatever this number is, let me call it P. Doesn't really matter, you can just calculate it, because this sum is what, three, six, ten, twenty one, right? So, it's twenty one times one twenty, whatever it is. So, let's call it P. Now, what will be if I will summarize the digits of the second column? Well, it will be exactly the same number P, right? However, what's interesting is that this particular, the first digit has a weight one in the position, decimal positioning system. The second digit has the weight ten. The third has the digit one hundred, one thousand, ten thousand, and a hundred thousand. So, if I want to summarize everything, I have to not just summarize each column separately. I have to each column separately, the sum of digits of each column separately, which is this number, I have to multiply by its weight, right? So, the total sum of all these would be P times one, which is the weight of one, plus P times ten, plus P times one hundred, plus P times ten thousand, plus P times ten thousand, plus P times hundred thousand, right? Which is equal to P times one, one, one, one, one, one. That's what it is, right? If I will summarize one, plus ten, plus a hundred, plus thousand, plus ten thousand, plus one hundred thousand, that's what I will get. So, if I will multiply twenty one by one twenty, which is P, and then I will multiply P by one hundred and eleven thousand, one hundred and eleven, that would be my answer. Whatever that answer is, and again, it's listed on the Unisor.com in the notes for this lecture. Alright, such a, well, difficult test, but we conquered it. Now, if somebody wants to, and if somebody can program the computer, you can just do what I did to verify my answer. I just wrote a small program in C++ language, and basically did this loop of summarizing all these six digit numbers, and I got exactly the same number. Just a confirmation. I was curious, you know. Alright, next. The task is to find out how many divisors a number has. Like, let's say, take the number six. Well, it has a divisor, and by the way, as a divisor, I would like to include number one, just for simplicity. So, divisors are one, two, three, and six. So, we have six divisors, right? Now, how can I calculate for any given number how many divisors it has? Well, first of all, what's very important is to represent the number as a product of prime numbers. I mean, that's the essence of calculating the number of divisors. Like, for instance, six is equal to two times three. These are two prime numbers. So, let's just think about it. Number two can be either absent or present with the power of one, right? So, it can be either the power of zero or two to the power of one. And three also can be either the power of zero or three can be the power of one. So, we have four different variations. Now, two to the zeros and three to the zeros together, they give one. Two to the zeros and three to the first gives three. Two to the first, three to the zeros gives two. And two to the first and three to the first gives this. Now, what if you have a little more complex case? Let's take twelve. Again, one, two, three. Now, four is also a divisor and six is a divisor and twelve, right? So, we have six different divisors, right? So, how can we obtain this from the number twelve if I will represent twelve as two times two times three? These are prime numbers, right? Or a little bit shorter, two square times three. Well, let's just think again, if this is the representation of the whole number, then I can have two in either zero or first or the second power, right? And three I can have with either zero or first power. Well, let's combine these three choices and these two choices and we can have all the combinations and we will have exactly six. Three times two is exactly six number of choices. This and this gives me one. This and this, two and three gives me this. This and this gives me this. What else? This and this gives me this. This and this gives me this. And this times this gives me this. All right, so I have obviously all the choices. So, here is the general explanation of the problem which I have at hand. Let's consider you have some number which is represented as a product of prime numbers in some power. Prime number two in the power n2. Prime number n, well, let's call this number x. I'll have x to the power nn. So, there are n different prime numbers in different powers and all together as a product they represent my number x. Now the question is how many divisors this particular number x has? Well, very simply, since these are maximum powers, these prime numbers can actually be included into the different combinations to provide divisors. So, divisor is basically any combination of these, right? So, I can have p1 in different power from zero to n1. I can have p2 from zero to n2. So, basically these are all the different choices which I have to make to construct my divisor. So, p1 in any power from zero to n1, p2 in any power from zero to n2, etc. So, if I will combine whatever I have chosen, I will have a divisor, obviously, right? Because any divisor is a combination of the same p1, p2, etc. pn in some powers. Well, so how many choices do I have here? Well, obviously I have n1 plus 1, right? From zero, I start from zero and end with n1. Now, with each of them, I can have as many as n2 plus 1 choices for the second prime number, etc. And the last one would be this. So, the product of these is actually the number of divisors. So, all I have to know to calculate the number of divisors is the initial representation of my number X as a product of prime numbers in some powers. By the way, there is a very interesting theorem in the number theory that this representation is actually unique. So, if you have two different representations with two different sets of prime numbers and different powers, that's actually exactly the same representation. Representation as a product of prime numbers is unique. Well, so that's the answer and that ends the session. I recommend you to go to theunisor.com again and review all these problems presented as this particular lecture. But just by yourself. So, thanks very much and good luck.