 Hi, I'm Zor. Welcome to a new Zor education. Continue talking about expectation of random variables or mathematical expectation or just expected value of random variables. So, the previous lecture was devoted to basically definition of this. I will remind it. Now, I would like to present a couple of examples. It probably would be advisable to listen to this lecture from Unizor.com website because there are some notes for this lecture which are very useful to understand the theory behind all this a little bit better because, you know, it's always easy to read something and listen then just listen, right? All right, so let me remind the end of the previous lecture the definition of the expectation for the random variable. Let's consider we have a set of elementary events which can happen as a result of certain random experiment and these elementary events are like this and each of them has certain probabilities associated with it. Obviously, the sum of these probabilities equal to one and with every elementary event there is an associated value of the random variable. Let's say it's x1, x2, xk. These are numbers and the model of this is, for instance, how much you win if there is a certain result of the game. So, these are results, different results of the game and these are your winnings depending on these results and you get these winnings with these probabilities. So, this is basically the definition of the random variable c which is a function of the elementary event and it's equal to xi. So, if this is the result of experiment then the value of our random variable is xi. Now, the expectation or mathematical expectation or expected value of our random variable is defined as basically the average value of our random variable per experiment if the number of experiments grows to infinity and we have evaluated it. The formula is basically sum of products of the probabilities by various. So, that's the definition and the derivation of this formula is very simple because if you have n experiments then approximately n times p i is the number of times the elementary event e i actually occurs and in which case we have the value xi. So, you have to just summarize these n times p i times xi, summarize y i and the y by n obviously because you want it per average per experiment and that's why we have this formula. Alright, so this is a very quick reminder of the last lecture. Now, the two examples which I would like to present to you and I would like actually to calculate the expected value of certain random variables. Okay, experiment number one is two dice. So, you are rolling them and you summarize the numbers which are the result of this. Now, what numbers actually are possible and what their sums actually are, right? So, the numbers are well, let's just think about how many different combinations. Well, it's 36 different combinations, right? Because six values for one dice and six values for another dice. So, we have 36 different combinations. Now, not every different combination produces a different sum of the numbers, right? For instance, combinations 5, 1, 4, 2, 3, 3, 2, 4 and 1, 5 all produce as a result a sum of 6, right? So, let me instead of going through all 36, well, I mean, I can actually go through all the 36 and probably it would be easier and more understandable. So, we will have a table if you wish, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6. So, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6. So, this is the first dice, this is the second dice and on the crossing, I will put the sum of them, right? So, sum of 1 plus 1 is 2. Here, 3, 4, 5, 6 and 7. 1 plus 6. Here, 1 plus 2, 3, 4, 5, 6, 7, 8, 4, 5, 6, 7, 8, 9, 5, 6, 7, 8, 9, 10, 6, 7, 8, 9, 10, 11, 12. So, sum of 2 numbers can be from 2 to 12 and what we actually have to do is each square in this table represents a particular random experiment and this is the result of the first and this is the result of the second dice. Now, so each square has a probability of 136, right? So, there are 36 square 6 by 6. Each combination of 2 dice has exactly the same chances to occur as any other combination. What I have to do is I have to add 2 times 136 plus 3 times 136 plus 4, etc., etc., etc. Or if you wish, I can group together all 3s, all 4s, all 5s, etc. And what will I get? Just easier to calculate it this way because these are repetitive items. Now, 2 I have only in one case. So, it's 236. Now, 3 I have in 2 times. So, it's 2 times 3 divided by 36. 4 I have 3 times. 5 I have 4 times. 6 I have 5 times. 7 I have 6 times. 8 I have 5 times. 9 I have 4 times. 10 times 3. 2 times 11. And 1 is 12. So, that's basically the result of accumulation of products of the probabilities and values. So, my random variable takes, for instance, the value of number 4, 3 out of 36 times. So, its probability is 3 times 3 divided by 36. Sorry, number 4 is 3. 3 divided by 36. The probability to take number 7, for instance, is 1, 2, 3, 4, 5, 6. So, it's 6, 36 times 7. So, these are basically exactly what I have just counted. The probability of if x1 is 2, then the p1 is 1, 12. If x2 is 3, then p2 is 236, etc. And the result of this, by the way, is 7. So, the average sum of 2 dice is 7. That's the expectation. Again, it doesn't mean that all this occurs, obviously. But as the number of experiments, number of times we roll 2 dice increases to infinity, then the sum of these 2 dice, 2 numbers on the top of the dice per experiment, the averaging per experiment, would tend to be, would tend to number 7. So, that's basically the whole story is about. So, whenever you are throwing 2 dice, well, on average, you will get the sum equals to 7. Sometimes more, sometimes less, the average would be 7. And again, it's not exact number, that's the number it tends to, as the number of experiments goes to infinity. So, the more you play, the more your average would be closer to number 7. Alright. By the way, in the notes, I presented slightly differently. I presented more like this particular thing in the table. Okay. Next problem. Next problem is about the card game of Blackjack. Now, you know that in Blackjack, whenever you get a card, it has certain number of points, right? If there is a number on the card, from 2 to 10, the number of points is exactly what the number on the card is, from 2 to 10. Then you have Japs, Queens, Kings, and Haces. And each of these also, each of these is also 10 points. So, this is the card. This is the points. Each of these is 10. And Haces actually either 1 or 11, depending on what you really want it to be. Now, in my particular example, in this particular example, I would like to simplify a little bit the rules. Just for this example, I consider that the value of Ace is always 11. It's just easier to calculate. So, we have a random variable being equal to the number of points whenever you pull a card from the deck. Now, let's assume that the card is complete, 52 cards, which means 4 of each for 4 different suits. And it's a complete deck, so I have 52 cards and I'm picking up 1. Absolutely randomly. Now, the number of points on this card is calculated based on this particular definition. And the question is, what's the average value of the card which I am putting out? What's the expectation of this random variable? Well, it is a random variable. Our set of elementary events is each particular card and there are 52 different cards, right? And the value of the variable for each card is described as we see it here. Okay, let's go back to our definition of the expectation of the random variable as the sum of these products. Okay, what's the K in this case? K is basically a number of different elementary events and it's equal to 52, right? Because we have 52 different cards in the deck. Now, the probability p i's are all equal to 152nd, obviously, and x i's are basically calculated based on this table. Well, again, we will do a little simplification because many different cards, as you see, have exactly the same value. For instance, the value 2 is assigned to four different cards corresponding with the four different suits, right? So, same thing was 2, 3, etc. and 10. Now, the jack also has 10. So, there are four different jacks in the deck of cards. So, the number 10 is kind of peculiar. Let's put it this way. But others are relatively simple. So, what are the values? Values can be from 2 to 10 to 11, actually. How many cards? With 2, we have four cards. With 3, we have four cards. With 4, we have four cards corresponding to the four suits, right? Same thing for this, same thing for this, same thing for this, same thing for this and for this. With 10, slightly different. We have 10, jack, queen and king. So, it's 1, 2, 3, 4 times four different suits. So, it's 16. So, 16 different cards have the value of 10. And again, four different cards, four aces have the value of 11. So, the probabilities are correspondingly for a number 2. So, this is an X and this is a probability I have to actually divide by 52, all of them. Now, if I will multiply the value of the variable times its probability and add them all together, according to this formula, right? It's the product of the values and probabilities. Then I will get my expectation and I have calculated it and it came to about 7.3. So, expected value of the card which you randomly pick from the deck of cards, expected value 7.3. By the way, there is a very important difference between these two examples. In the first example, I had seven as an average of sum of two dice and that is one of the actual values which this sum can take. If, for instance, you have three and four or five and two or six and one, et cetera. Now, in this case, 7.3, this is the value which you will never attain by picking the card. There are no cards with this particular value, right? It's just the average which means that if you will play the same kind of games, you conduct the same experiment from the full deck of cards, you pick one and then as the number of experiments goes to infinity and you are averaging the number of points which you are getting, averaging means down to the single experiment, then you will get the number like this. Well, in theory, in, well, this is the theory, right? Right now, let's talk about the practice actually. Blackjack as a game is a little bit more complicated, not only because the ace has your choice of the points, one or eleven, also because you are not actually picking the cards from the full deck all the time because there are certain cards which have already been given to other players and to a dealer. So that actually complicates the picture and if you know, for instance, all the cards which have been already previously taken from the deck and you know the composition of the deck because sometimes actually casinos are playing with more than one deck of cards, like five or six decks of cards, that obviously changes the whole statistics. So this is the simplification of the real thing and I don't want you to take some kind of a conclusion from this that, for instance, if you have, let's say, two cards already and they amount to 14 points, if you take one more, if you ask for one more, you will get an average 21.3 which is above the 21 limit which you can get, which means that in more than one half of the cases you will have the number which will lead you to losing of this particular game. I don't want you to make this conclusion because the conclusion actually is not correct because this is the pure theory in the simplified version. The practices is completely different and it's much more complex actually. But in any case, if for instance you are playing with really large number of decks, when the previously taken cards to one or two players actually don't change much, the probabilities of picking the card for you, and if the shuffling is really random, etc., etc., then you might expect that the next card will have an average value of, well, seven, maybe 7.1, 7.2, it depends actually. But close to this, which means if you have, for instance, I don't know, 16 on your hands, and to ask for another card would be basically an open invitation to get the number which is above, which will lead you to a losing game because you will have on average more than 21. If you have something like 12, well, you definitely might actually expect that on average it makes sense to ask for more cards. Somewhere in between, like 13, 14, 15, it all depends on how other cards have already been laid off. All right, so this is my second example. And again, just pay attention in this particular case, especially, that the average value is not necessarily one of the real values which random variable takes. These are the real values. There is no 7.3 here, right? But an average, yeah, obviously, can be something like this. And just one extra, I think interesting comment on this. Intuitively, people are thinking that if you have a random variable and you know its average value, its expectation, it really kind of characterizes the, well, at the name expectation, right? So it characterizes what to expect when the new random experiment actually is conducted, what to expect as the value of this variable. And this is, or at least approximately, this is not actually always the case. Sometimes this expectation has absolutely no value at all. And let me give you an example, actually. Well, if you, for instance, play a very simple game of heads and tails, so either you win one or you lose one, depending on what exactly your bet is, well, the expectation of this game is zero. I mean, what does it mean? Basically, nothing. Even more ridiculous example is, well, women have two breasts and men they don't, basically, right? So if you pick a random person from the crowd with the probability of one half, let's say it's even crowd, with the probability of one half you have a woman with two breasts, and you have a man with the probability of one half with no breasts. So what does it mean? That the probability, the expectation of the variable which is number of breasts is equal to one, so the average person has one breast, doesn't make any sense at all. So let's not put a lot of practical value in this, and let's understand the limitations of this particular characteristic of the random variable. It has its limitations, but in some cases, the expectation, the average value does make sense, and it does characterize something which you might expect actually from the future values of the random variable. So in this particular case, although you don't really know what exactly the card will be, but well, if you play a lot, then on average, you might get something around this value of the next card which you're actually picking from the deck, all right? Okay, that's it. Thanks very much. I do suggest you to read the same lecture, the notes to this lecture on Unisor.com. It would be very helpful. That's it for today. Thanks very much, and good luck.