 Hi, I'm Zor. Welcome to a new Zor education. This lecture is the first one in a series of lectures dedicated to solving different combinatorial problems. I think it's very important to solve combinatorial problems because it really develops your logic. And considering that the answers are not always so obvious, it's really very educational. And as a training of your mind, that's an excellent tool. Besides, those of you who are interested in computers would find this particular type of thinking, the combinatorial thinking, to be very useful in the professional life of people who are related to computers. So that's my preamble before this series of lectures. Another thing which is important is it's very beneficial if you try to solve these problems yourself, regardless of whether you will do the right or the wrong way, because you just have to spend some time thinking. Now, thinking is always good for your brain. It's like, basically, exercise is good for your muscles, thinking is good for your mind. Now, to do that, I would suggest you to go directly to Unizor.com. So if you're watching this lecture on YouTube or any other source where you have just this particular lecture, that's not what I actually intended. Go straight to Unizor.com. This lecture is presented there as well with notes, and notes basically contain the problems. Then there is an answer, so you can check your solution, and then there is a logic how I would basically derive this particular answer. So you can check your logic against what we are suggesting on the website. Alright, so that's it. So let's go to the problem solving. Now, I have four different problems for this particular lecture, so let's just go for it. Problem number one. Okay, you have n different objects. Now, you have to make a partial permutation of k objects out of this n. Obviously, k is not greater than n. However, there is one more condition. X objects in this group of n are marked, well, with a letter x, if you wish. And these x objects are supposed to be always part of these k, which I am selecting as a group from n. So I have to select k object out of n in such a way that x marked objects are always part of the k. So always part of the k means that the x is supposed to be less than or equal to k, of course. Alright, so that's the problem. Question is, well, that's the condition of the problem. And the question is, how many of the different partial permutations of k objects out of n exist with x marked objects from n always participating among these k? Alright, so let me approach this problem the following way. First, I would like to find how many different combinations, not permutations, combinations of k objects out of n exist such that x marked objects participate in the k objects. Once I find the number of these combinations, all I have to do is multiply it by k factorial to find how many different permutations within this selected subset actually exist. And that gives me the number of partial permutations, right? So partial permutation is basically equal to the number of combinations times the factorial of the number of elements. Alright, so my first question is how many different combinations of k objects out of n exist with x marked objects being part of the k? Well, that's actually very easy because among these k, x is already chosen. What's left, where do you have the freedom of choice? Well, you have it to choose the remaining k minus x objects out of remaining n minus x. So if x is already chosen from the n and put into the group of k, then there are n minus x remaining objects and k minus x spots to fill. So basically this is c of n minus x by k minus x, which is equal to, if you wish, n minus x factorial divided by k minus x factorial and n minus k factorial. So that's number of combinations of k objects out of n with x preselected objects to be part of these k. All we have to do now is I have to multiply it by k factorial because all the permutations of this already selected group of k objects are different partial permutations, which we are looking for, right? So basically the answer is k factorial multiplied by this number of combinations of k minus x objects out of n minus x. That's the answer. By the way, if you come up with the same answer somehow differently using different logic, that's okay as long as you know what to do. Alright, next. Next we have a set of six letters. A, B, C, D, E, F. Now I have to select, I have to have, I have to calculate how many partial permutations. Again, we are talking about partial permutations of four letters out of these six and again there is a condition such that in each permutation which I am talking about, there should be letter A prior to F. So permutation is not only selecting certain subset but also putting them in order. So in that order A precedes F. Okay, so what I am going to do is exactly the same as what I did in the previous problem. First I am seeing here that the letters A and F are already preselected. So out of these six letters any partial permutation which I am talking about is supposed to contain A and F, right? So let's start with again number of combinations which I can select of four different letters out of these six such that A and F include it. Then I will think about which permutation of this subset is good when A precedes F and which is not. Alright, so the first problem, now my two letters have already been chosen. So I have two remaining spots in the group of four, right? And I have four different candidates B, C, D and E because A and F are already chosen. So basically what I am talking about is talking about combinations of two out of four. So out of B, C, D and E I have to choose two representatives and include in my subset. Now my subset includes A, F and a couple of letters. And the number of these subsets is this which is by the way four times three, one times two which is six. Alright, okay now I have a subset of four letters A and F are present among them. And I have to permute, I have to change the order to get all the permutations but only those where A precedes F. Now how many permutations exist out of four objects? Well obviously four factorial, right? But not all of them are where A precedes F. But let's think about it. All the objects are in some way equivalent in their rights which means that the number of permutations where A precedes F should be exactly the same as the number of permutations where F precedes A, right? So they are absolutely symmetrical. So basically I have to divide it in half. So half of these permutations are where A precedes F and another half is where F precedes A. Obviously there are no other choices and only choices are equivalent so that's why I just divided by two. So the answer is I have to multiply the number of combinations times number of permutations where A precedes F. So that's the result which is what? 3, 24, 7, 2. That's the answer. Next. Next you have n-sided convex polygon. In this case it's 5, right? Now we have all the different diagonals. We have five diagonals, right? So we have five diagonals and we have five intersection points inside. So now the problem. Given an n-sided convex polygon, convex polygon, then we draw all the diagonals and let's assume that there are no points where three diagonals intersect, right? So all intersections are only of two diagonals. The question is how many intersection points exist inside this particular polygon? We do not count the vertices where obviously diagonals are also intersecting there but that's not what we count. We are counting only what's inside, right? So that's the question. Now it looks like it's a geometric problem, right? But it still has its combinatorial kind of a flavor. So what's the flavor? I was actually thinking about this problem myself for some time because I'm trying to solve all the problems before I'm presenting it to you, right? So how I approach this particular problem? Let's consider one particular intersection point. Well, let's say this one, okay? Now this particular intersection point is intersection of two different diagonals, right? Now obviously these diagonals do not have common vertices, right? So these two vertices from which this diagonal is drawn are not the same as this one because otherwise we would have a vertex. If two of these four points, this point, this point, this point, and this point, the end points of these two diagonals, if any one of those points coincide that means we have a vertex and we have excluded the vertices, right? So basically we always have four points. Now this is a convex polygon which is important, right? So all these four points form a quadrilateral, right? So now let me just make a statement. So every intersection point corresponds to some quadrilateral because if you take any intersection point you have these two diagonals, so we have four points which make a quadrilateral. If you have any quadrilateral then by putting two diagonals of this quadrilateral we always have an intersection point, right? So basically there is a one-to-one correspondence between intersection points and all the possible quadrilaterals which can be formed from the vertices of this particular convex polygon. So the question is how many quadrilaterals can be formed from the vertices of this particular n-sided polygon? Well obviously any four points which we choose from n would actually be good enough to make a quadrilateral. So the answer is number of combinations of four vertices out of n vertices. And I'm talking about combinations now, not the partial permutations or anything like this. So again any four points, any subset of n vertices which has four points is basically defining the intersection point and the intersection point defines the quadrilateral. So that's why this is the answer. Well as you see in this particular case I didn't really count the intersections because I just don't know how to do it. I modeled my problem, I have shifted my problem from one angle to a completely different angle because if I will ask you in the very beginning how many different quadrilaterals is possible to construct from the n vertices of this polygon. Obviously the answer is number of combinations from n by four. But that's not the question. The question was how many intersections of diagonal. So it's a completely different question but it actually leads to the same problem. And what's interesting is you have to like transform a difficult problem which you don't know how to solve into the equivalent problem which basically is kind of obvious. Alright, next. The fourth and the last one. You have n points on the plane. Now in each point you have m lines. The question is how many intersections. Well except these. I apologize for this sound. It's some construction is going on. Well anyway, so question is how many different intersections exist among these lines. Assuming obviously that there are no parallel lines and there are no points where three lines intersect. Alright, let's think about it. So we have m points and m lines from each point. Alright, let's think about it this way. If I take one particular point out of these n and then another point out of these n. I am taking a bunch of lines from one point and intersecting with a bunch of lines in another point. Well obviously all the m lines of one would be intersecting with m lines of another. And number of intersection points would be m times m which is m squared. So for every pair of points out of these n I can have m squared different intersections. Now the final result actually depends on how many pairs I can choose. Because any different pair will give me a completely different set of points, right? So how many pairs? Well obviously number of combinations of two out of n. That's number of pairs. So the answer is you have to multiply them. m squared times the number of combinations of two from n. And that's the answer in this particular case. Well that's it. I think I will continue constructing these lectures with certain number of problems. And continue as many problems I will be able to solve myself. It's very important to go through many many problems with this particular combination. The combinatorics theme. They are very very helpful in developing your logic. And well not only in computer science actually where this logic might get handy. Many other places as well. But in any case that's it for today. Thank you very much. Don't forget to go to Unisort.com and go through the same problems again maybe. Just by yourself and check if you have the same solution. Also of course if you register to Unisort.com it will allow you to basically go through the whole course of advanced mathematics with exams and basically marks as completed certain topics whatever your progress actually is going through. So thanks very much again and good luck.