 Hi, I'm Zor. Welcome to New Zor Education. I wanted to introduce some very simple problems related to calculation of the correlation coefficient, which we have discussed in previous lectures. But before doing that, I really had to prepare certain more, I would say, more simple tasks, which would lead us to calculations of the correlation coefficient. And I have decided basically to break it into lectures, not to overload you. So, this one, this lecture, will be very, very simple, and it will be basically a preparation for the next lecture, which will be devoted to calculations of the coefficient of correlation. Now, in this lecture, which I have basically structured as a couple of problems which we will solve, I do recommend you to try to solve these problems just by yourself. It's very simple things. Everything you know should be sufficient. But I will do exactly the same, but again it's a very simple thing. Obviously, I usually mention that this lecture as well as anything else is part of the Unizor.com educational website, which is dedicated to presentation of advanced course of mathematics for teenagers and high school students. So, again, this is basically three very, very simple problems, which are supposed to prepare you for the next lecture where I will try to calculate the coefficient of correlation in one specific case. And I will present this case right now, gradually, as I will unravel all these three problems. The problem number one, which is extremely simple, as follows. Let's consider we have a random variable Xe, which takes only two values. X1 with probability p and X2 with probability 1 minus p. So, no other values, just these two variables, these two values, and probabilities that's y is equal to 1 is p and another is 1 minus p because there are no other values. So, it's very much like Bernoulli variable where it's only usually like 0 and 1, but right now it's X1 and X2, just different values. So, our purpose is just looking at this particular random variable. Let's calculate its mathematical expectation and variance. Simple thing, right? So, what's the mathematical expectation? Well, mathematical expectation of a random variable is weighted sum of its values, where the weights are the probabilities, which means it's X1p plus X2, 1 minus p. That's it. Now, variance is basically an average square deviation from the expectation, which can be expressed as expectation of Xe minus E of Xe square, right? Well, at the same time, as you know, if we will open the parenthesis, I did it many times, it's expectation of Xe square minus 2 Xe expectation of Xe and plus expectation square of Xe, which is equal to expectation of Xe square, right? expectation of sum is sum of expectations minus 2 is a constant, E of Xe is also a constant. So, I can take it out from the expectation and what's left? Well, left is just Xe, so it will be expectation of Xe and plus expectation square of Xe. Now, this is minus 2 expectation square, this is plus 1, so it will be minus 1. So, let me just do it this way. Okay, now using this formula, so it's expectation of a square minus square of expectation. Now, expectation we know, so we very easily do the expectation square. And expectation of square of Xe square, well, that's basically, okay, Xe square takes value X1 square with probability p and X2 square with probability y minus p. So, expectation of Xe square is X1 square p plus X2 square 1 minus p. Now, minus square of expectation, now it's square of this guy. Minus, okay, let's square this one. It's X1 square p square minus 2 X1 X2 phi 1 minus p and minus X2 square 1 minus p. Square, right? Equals, okay, what can we do here? Well, let's get X1 and X2 separately. I mean, I would like to simplify this formula. There is probably a better way of expressing this thing. So, if I will take this and this, this is X1 square. It would be X1 square p minus p square, which is p minus p, right? This and this would be X1 square and then p minus p square p outside of the parenthesis. So, I have 1 minus p. Okay, now let's talk about this guy and this guy plus X2 square. So, what will I have? 1 minus p minus, why not minus p square? So, I will take 1 minus p outside of the brackets and in parenthesis I will have 1 minus 1 minus p, which is p. And minus 2 X1 X2 p 1 minus p. Okay, now that's easier because what we will do right now is we will take p times 1 minus p is everywhere, you see? And if I will factor out p and 1 minus p, what will be left? X1 square X2 square minus 2 X1 X2, which is X1 minus X2 square and p1 minus p. So, that's my variance and this is the final answer. By the way, to my recollection, if we were talking about Bernoulli variable, which takes value 0 and 1 with probabilities 1 and 0 actually, with probabilities p and 1 minus p. So, this is 1, this is 0. And I do remember that mathematical expectation was p and that would be exactly the case because this is 1 times p and this is 0 times 1, so it will be p. And variance as far as I remember was p times 1 minus p. And this is also true because this is 1, this is 0, so it's 1 square, so p1 minus p is left. So, it's correct. Alright, so the first problem is solved. And again, I repeat, this is just the preparation for the calculation of correlation coefficient. Now, the second problem, again, that's the preparation for correlation, so I need two variables. So, let's just introduce two variables. So, one variable is equal to X1 with probability p and X2 with probability 1 minus p. And variable eta, which is equal to Y1 with probability q and Y2 with probability 1 minus q. Now, these are two variables. And yes, in the future, I would like to find out what's the correlation between them. But that's not so easy right now. This is not sufficient information because they might be independent, in which case correlation might be zero. It might be something else, might be half dependent or God knows what. So, I have to introduce some more information into this picture to basically define how these two variables are related to each other. Let's think about it. Basically, what we are interested is what's the probabilities of them together taking certain values. Now, what values can they take? The variable Xc can take value X1 or X2. Variable eta can take Y1 or Y2. Now, we know that the probability of Xc to take value X1 is p and the probability to take the value X2 is 1 minus p. Whatever values eta take doesn't really matter. Now, eta by itself can take either Y1 with probability q or Y2 with probability 1 minus q. Now, we have four unknown inside and these are mutual distribution of probabilities. So, I have to define something and I will define this one. So, let's introduce new variable which is the probability of Xc equals to X1 and eta equals to Y1. And I just have to define it. I mean, there is no way I know this in advance and it's not following from anything like this. This basically defines a common distribution of Xc and eta. So, what's the probability of them at the same time take these particular values? Actually, that's all I need because everything else can be derived. Why? Well, I know that some of this and this. So, what's the probability of X1 taking X1 and either eta take Y1 or eta take Y2? I know the probability is p because it's not dependent on eta. It can be any Y1 or Y2. So, the sum should be equal to p. That's why this is supposed to be p minus r. Same thing down. The probability of eta to take value Y1 is q. Now, if at the same time Xc takes X1, it's r. Now, it can be either X1 or X2. So, this probability should be q minus r. And correspondingly, this thing also can be 1 minus p minus this, which is 1 minus p minus q plus r. 1 minus p minus q plus r. So, now I know all the common probabilities. Probabilities of these two random variables to take simultaneously some values. X1 and Y1 is this. X1 and Y2 is this. Some of them, which means C is X1 and eta is any. It's supposed to be p and it is. Similarly for all others. So, I know the probability distribution of my pair Xc and eta. And that's very important because it's actually the probability of the combination of these two random variables. That's what I need to calculate any kind of correlation between them. Because I will deal with something like, if you remember, coefficient of correlation related to covariance. And the covariance is related to expectation of their product. And I cannot find out this without combined distribution of components, since it's not independent variables. Okay, so basically this is my second problem. I have explained, if I have only one particular probability, this one, then everything else is derived. Now, obviously I'm talking about a very simple case when every random variable takes only two variables. That's why it's sufficient to define one pair so other pairs are derived. So, I need this new parameter R. So, not only p and q I need, I also need the parameter R to define completely all the distribution of the pair Xc and eta together. So, that's my second problem. And my third problem is related to, again, if you remember, covariance. Well, coefficient of correlation is related to covariance and some square root of the product of their variation. So, I need covariance. And covariance in term is related to expectation of the product minus product of expectation, right? Now, product of expectation I can find out. Actually, that was the first problem. And now I need this guy. And for this, I need this result of the second problem. So, my third problem is what is the expectation of the product of these two guys. And for this, I will need this matrix, obviously. And let me just wipe out this. So, I will have more room. So, let's assume I have two random variables. One will take these values with this probability. Another will take these values with these probabilities. And the combination of their values has these probabilities where are yet just another number, another constant. So, what is the expectation of the product? Well, the product takes four different values, right? X1, Y1, X1, Y2, X2, Y1 and X2, Y2. Each one of them has its own probability, right? So, basically, I just have to summarize all the values weighted with corresponding probabilities as we usually do. So, that's X1, Y1, R, plus X1, Y2, P minus R, plus X2, Y1, Q minus R, plus X2, Y2, Y2, P minus R. y2, y2 times 1 minus p minus q plus r. So that's my expectation. So all I need to do right now is maybe express it in some little bit more concise way. But in any case, whether I will or I will know, it doesn't really matter. This is my probability, my expectation of their product. And knowing the expectation of the product in my next lecture, so right now I'm going to stop here. In my next lecture, I will try to find out the correlation coefficient. So I will calculate, I know from this lecture, I know expectation of each one and variance of each one, c and eta. Now I know the expectation of the product. And that's sufficient, which will be a subject of next lecture. It's sufficient to find out the correlation coefficient between these in terms of r, p and q, obviously. All right? So that's it for today. I do suggest you to repeat these calculations just yourself. I think it's a very good exercise. So the first problem, the second and the third, they're all listed on Unisor.com as three different problems. I have answers. I don't have calculations in the notes, but I have answers. So you can basically check yourself. Okay, that's it for today. Thank you very much and good luck.