 Hi, I'm Zor. Welcome to Unisor Education. This lecture is a continuation of the course of advanced mathematics for high school students. The course is available on Unisor.com. It's free. And I do recommend actually to watch this lecture from this website rather than directly from YouTube or any other website because the Unisor.com contains notes for every lecture. It's also supposed to be like a complete educational system with exams and ability of parents or supervisors or group teachers to basically assign the proper course of action for any student, individual, family based on his or her abilities. Now, this lecture is about variance and the standard deviation of random variables. I would like to present you a couple of examples actually. The theoretical material is supposedly covered in the previous lectures. So I would like just to talk about one or two particular examples of how the probabilistic characteristics of the random variable can be calculated and basically used to evaluate how it behaves. All right, so the first example is the game of roulette. And I'm considering a simplified game of roulette when there is only one way to play it. You pick a number from 1 to 36. Let's say you pick a number 23 for instance. Now, then there is this spinning wheel with numbers from 1 to 36, number 0 and double 0. I think there is a difference between American and European way of playing the game. Americans have double 0 as well. Anyway, let's say you bet $1 in case you lose and the ball which is spinning on this wheel stops on anything but 23. You basically lose your dollar, so this is the minus. In case it stops on 23, you win $36. Okay, so this is the game. And my question is basically to evaluate all these three major characteristics of the random variable, which are expectation, variance and standard deviation. Now, expectation is something which you can consider like an average value, but it's not just an average value. It's weighted average value where weights are the probabilities of different results of the game. Now, the variance is a characteristic of average deviation of the values of the random variable from this expected value. But this is a square actually of this deviation. And again, it's averaged based on probabilities as weights. And standard deviation is basically a square root of the variance to bring the dimension to the same basically units as random variable itself is measured. Alright, so let's just do all these things. And first of all, whenever you're dealing with calculation of these characteristics of random variable, you have to know exactly what values this variable takes and with what probabilities. Well, you might actually start from elementary events. Now, how many elementary events are? We have 36 numbers from 1 to 36, 0 and 00, all 38, 36 plus one and plus another one, all 38 different occurrences or outcomes actually of this game are equally probable. So what does make sense to basically assign as probabilities is 138 to each and every elementary event. Now, we have 38 different elementary events, equal chances. So everyone has a probability of 138, which means we will repeat this particular experiment spinning the wheel and throwing the ball on it one million times. Well, approximately each one of those numbers very approximately, not exactly, but each one of these outcomes will occur approximately one million divided by 38 times. Obviously, not all of them will be, you know, on this level, some of them will be a little more, some of them will be a little less. But the more you play and the more experiments you conduct, the closer your relative frequency of each of these outcomes will be to 138. All right. Now, so which of them are winning, which of them are losing out of these different 38 different combinations, different outcomes? Well, there is only one winning when the ball stops on the spinning wheel in the cell with the number 23 in it because we bet on number 23. So there is only one winning elementary event. All other elementary events and there are 37 of them are losing. So the probabilities of the winning is 138. The probability of losing is 37, 38. So these are basically two different probabilities which we should really deal with because in this case we earn, well, we win 36. And with all these cases, all elementary events which are losing, you will lose one dollar. So it's minus because you're losing one times the probability. So this is basically the expectation of our variable. It's weighted average and the weights are the probabilities of all the different values this random variable takes. And the values are only two values, 36 if we win and minus one if we lose. So this is basically the expectation. This is my expected value. And it's equal to 36, 38 minus 37, 38. It's 138 with a minus sign. Now minus sign is very important for you and for casino where you are playing. Since it's minus, then you can assume that on average you probably from each dollar you will lose on each game 138. On average, which means if you will play a million games, well, you will lose the corresponding proportionally corresponding number of games. So that's why the game actually is played in the casino. All the games which are played in the casino usually, I mean, I don't know the exceptions, have negative expectation. Why? Because casino wants to make money, obviously. All right. Now, how is the dispersion or difference between different values which really occur in a real practical situation from this expected value? Well, that's what variance and standard deviation will answer us. Now, so this is approximately, by the way, in decimal minus, minus 0.026316. Just for anybody who is interested in decimal representation of this expectation. All right, so we found the expectation. Now, we don't need this. We got expectation equals minus 138. Now, what is variance? Well, variance is again a weighted average with the weights or probabilities, weighted average of squares of the difference between the values of the random variable and its expected value. All right, so we have only two different values, so the situation would be like this. Now, I have a value of random variable 36 and its deviation from my expectation is the difference between 36 and expected value. Now, I have to square it and multiply by the weight. Weight is the probability. Probability of winning is 138. Now, another value which this particular random variable can take is minus 1, right? So, it's minus 1. Again, it's deviation from, so minus 1 difference with expectation, square. And we have to multiply it by the probability of losing, which is 3738. Equals to 35.078355. Well, I just calculated this, no big deal. So, this is my variance. And again, let me just repeat that the variance is all about the squares. It's an average of the square of the differences, which means that it's kind of difficult using this variance to judge about the behavior of the random variable, which takes the values of basically dollars in this particular case, right? So, this is the dollar square and we need just dollars. So, for this reason, so this is the variance. We need the standard deviation, which is just square root of the variance, which is 5922690. Approximately 6. So, this is approximately 35, this is approximately, that's easier. Alright? Now, let me just put this thing on the line. So, this is 0, this is minus 1, this is 36. So, my random variable takes either this value or this value. But this value, it takes much more frequently with the frequency of 3738. And this value, 138, that's the frequency. Now, my expectation is negative and it's a very small one, but still negative. So, it's left of the zero. So, this is my minus 138, that's expectation. Now, around this expectation, the values of my random variable will fall, basically, right? Either here or there, here or there. But if I will summarize them and divide it to get some kind of an average distance from this particular variable, very well, the distance will be approximately 6 on both sides, which means I can lose around something, my winning will be around 6 and my losing will be around 6, so to speak, if I will start playing many, many different games. Alright, well, basically, that's it for this particular problem. And what I will do next is what all, well, typical mathematicians would do when they see something like these calculations, etc., etc. They will abstract out, so to speak, this particular task. They will introduce some letters and they will try to resolve the same problem in a more common case from which this particular problem would be just a particular case. So, what's my problem which can be some kind of a generalization of this problem? Well, it's very simple. So, you have the variable which takes two different values, X and Y, with different probabilities, P and Q. Well, obviously, since P and Q are probabilities, both of them should be greater or equal to 0 and some of them should be equal to 1. Since I have only two different results, my probabilities should add up to 1. And I have exactly the same problem. Calculate expected value, variance, and standard deviation. Alright, let's do it in this common case. And then we can assign to X, for instance, 36, to Y, we can assign minus 1. P would be 1, 38, and Q would be 37, 38. And basically, you know, substitute these values into a final formula and we will get exactly the same results. Alright, so let's do it. So, first of all, expectation. Again, this is a weighted average of the values where the weights are the probabilities, which means it's X times P plus Y times Q. That's it. There is no big deal, nothing to worry about. Well, obviously, you can always express Q as 1 minus P or P as 1 minus Q and reduce it to one particular probability rather than two. But it doesn't really matter. This looks more symmetrical and, again, in my personal view, a little bit nicer. Alright, now, variance. Weighted average of the squares of the differences between my value, my value is X, and the expectation. Well, expectation is X times P plus Y times Q. I have to square it. That's the difference, square. And with the weight of this particular value, X, which is P, plus, same thing, the value of the second value. Again, minus the same expectation, square. But with its weight, which is its probability of Y, which is Q, which is equal to, well, let's open up these parentheses and we'll have X minus XP minus YQ. Now, X minus XP is X times 1 minus P and 1 minus P is Q. So it's XQ minus YQ, right? So I will do X minus Y square and Q square and P. This P. Alright? Now, similarly here, Y minus YQ is Y times Y minus Q, which is YP, right? So YP minus XP square, so it's Y minus P square and P square and Q. Now, X minus Y square and Y, oh, this is a mistake. And Y minus X square, they are exactly the same, right? Because it's a square, so sign doesn't matter. So I can factor out X minus Y square. Q square, P, P square, Q, I can also factor out PQ and I will have, in the parentheses, Q plus P. But Q plus P is equal to 1, so I don't really need the whole member Q plus P all together. And this is my final answer. That's my variance. Finally, my standard deviation is square root of the variance, which is square root of X minus Y square, which is absolute value of X minus Y. And square root of PQ, P and Q both are non-negative, so square root always exists. Now, just pay attention that I use absolute value of X minus Y, because this is a square and the square root of a square is absolute value. So these are answers and these are actually a little bit easier to look at, at least from my personal perspective than that huge formula which I had in the previous problem, right? So for instance, if I would like to know my standard deviation, so what do I do in this particular case? So again, my X is equal to 36, I win. My Y is equal to minus 1, I lose. My P is equal to 138 and Q is equal to 37, 38, right? So what do I have? X minus Y, 36 minus minus 1, so it's 37, times square root of 37 divided by square root of 38. Something like this, right? Well, PQ, oh, I'm sorry, I don't need this square root here, because it's two of them, 38 and 38 and the square root will be here. So you can much easier calculate this value than these huge formulas which I used in the previous problem. And I did actually calculate it and it looked exactly like whatever I had before, 5, 9, 2, 2, 6, 9, 0. Square root of 37 is just a little bit more than 6, but then we multiply it by 37, 38 and it will be something like this, a little less than 6. So this is actually a nice example of how the general approach is easier than a particular case of that general approach to calculate certain things. All right, so this is it. Maybe I will put few problems of this type as exams for this particular topic, and that's it for this particular lecture. I do recommend you to review it again on Unisor.com using the notes. Just read the notes like a textbook that would be very useful. And well, that's it. Thanks very much and good luck.