 Hi, I'm Zor. Welcome to Unisor Education. This lecture is a part of Advanced Mathematics for Teenagers course presented on Unisor.com and that's where I suggest you to watch this lecture because there are comments and notes for this lecture right on the side of the video itself. So the website is a better source for watching all these lectures rather than YouTube or any other site. All right, so this lecture is about one concrete distribution of probabilities. This is a binary distribution and it's called Bernoulli. I have introduced two different binary distributions in the previous lecture. One of them is Bernoulli distribution and another is binominal. So we will talk about Bernoulli distribution today. So let me just remind you that we are talking about the space of two elementary events, which we have conditionally called success and failure. And our best example is tossing the coin where you have heads and tails. So this is all the elementary events we have. And let's say that the probabilities of occurring of these two elementary events are P and Q, where P plus Q is equal to 1, obviously. Now, so this is basically an abstraction which describes some experiments with two different results. Now, on this space of elementary events we have introduced a random variable, which is called a Bernoulli random variable, which is equal to 1 on success or 0 on failure. So this lecture is about how this particular random variable behaves, what's its characteristics? Well, there are basically two major characteristics of any random variable. It's expectation, mathematical expectation, or mean, or average, if you wish, which is not as scientific term, as mathematical term, I would say, in this particular case as mean or expectation. So I'll use expectation primarily. So this is one characteristic. And another characteristic is its standard deviation. So these two are basically quantitatively characterize how our random variable behaves. The expectation tells us, well, approximately where is averaging, where this particular random variable is averaging in its values. And standard deviation shows, well, how much around that average the values are spread. All right, so okay, so let's just do this type of calculations for this particular Bernoulli variable. So what we know is that the probability of our random variable to be equal to 1 is equal to p, right? And the probability of this random variable to be equal to 0 is q, or p plus q is equal to 1. There are no other values, just 1 and 0. Now, let me just stop for a second. Now, 1 and 0, well, they actually can be anything. For instance, they can be dollars, or they can be millions of dollars, or they can be anything which can be divided into pieces. Because, well, the average would be obviously between 0 and 1 somewhere. The mean therefore the expectation should be between 0 and 1, so it should be divisible. So to speak. This unit of measurement should be divisible. So again, this piece of some units of measurements, like dollars, for instance. Now, these p and q are probabilities. Now, probabilities are actually fractions. These are unitless numbers. So it's a number of successes divided by the number of all experiments, right? So it's just numbers. There are no kind of measurement unit in these p and q. But 1 and 0, they can be measured in something. Conditionally, for instance, we can assume that this is dollars, or it can be tons of sand, if you wish, or anything else. Alright, so now let me remind you what the expectation actually is. Expectation is weighted average of different values. So if our random variable c takes values x1, x2, etc., xn with probabilities p1, p2, etc., pn, then the weighted average of these values, x1 times p1 plus x2 times p2 plus, etc., plus xn times pn, this is the expectation value. This is a weighted average. So this value takes with this, well, frequency, if you wish, and this value with this frequency, etc. So that's how it is calculated. Now, in our case, there are only two values and two probabilities. So expectation of our random variable c is equal to its value times its probability plus another value times its probability. Now, this is unitless, and this is unitless. These are probabilities. Now, this is something like dollars or tons of sugar or anything else, as well as this. Now, the result is obviously p, but now this p has the same unit of measurements as 1 and 0. You understand that, right? Because these are unitless. These are fractions. Now, the fact that this p and this p have exactly the same values, just a coincidence, because this p is a fraction. This is a number divided by a number, number of successes divided by total number of experiments. This p is measured in exactly the same measures as our random variable, which might be just abstract number one, in which case it's an abstract number, but it can be a dollar or it can be a ton of sugar, right? So, this is our expectation. Well, first of all, intuitively it is understood that if you have two values, 1 and 0, which our variable can take, then obviously its expectation should not be greater than 1 or less than 0. It should be somewhere in between, because there are no other values. 0, 1, 0, 1, 1, 0, whatever else. So, somewhere the average would be in between. So, that's kind of obvious. Now, the fact that it's equal to p is also understood from statistical definition of the probability, because what does it mean that the probability of the success is equal to p? Since if you have a rather large number n of experiments, then p times n would be the number of successes, right? In which case, yes, and q number n would be failures, right? So, if I will try to average my results. So, if these are all the successes where I have the price of 1, and these are all the failures where I have a price of 0, and I will add them. Now, number of experiments is n, so I have to get the average value of our variable. I have to divide it by n. Obviously, I will have now, this is 0 and n will be out, so I will have only p. Alright, so that's my expectation. Let's recall it what the standard deviation is. Now, standard deviation is square root of variance, and variance is also something averaging. Now, when I'm talking about variance, I'm talking about averaging using the probabilities as the weights. Averaging of deviation of square of the difference between the value of our variable and its mean and its expectation. So, our variable has two values, 1 and 0, right? This is the probability and this is the probability. Now, the expectation of this variable, I have just calculated its p. By the way, if this is a ton of sugar, this is a ton of sugar and this is a ton of sugar. This is a dollar and this is a dollar and this is a dollar, right? So, now, the deviation is this in this case and this in this case. But I'm talking about square of deviation to basically get rid of the pluses and minuses. And I'm talking about weighted average, which means this is with a probability p and this is with probability q. So, that's my variance. Well, let's just simplify this formula. 1 minus p square is 1 minus 2p plus p square times p. Now, this is p square times q. q is 1 minus p equals to p minus 2p square plus p cube plus p square minus p cube. If I'm going to multiply this equals to p cube is out. So, it's p minus 2p square plus p square. So, it's minus p square or p times 1 minus p or p times q. You see how simple it is from this rather big formula to get a relatively simple result. So, that's my variance. Now, variance is, well, it's convenient but standard deviation, the square root of variance is more convenient. Now, what are the units of measurements of this? Well, the same as this p, not this p, this p and the same as 0 and 1 and this p. So, this is actually square of the units of measurements of the numbers we are talking about. So, if this is a dollar, this is a dollar square. If this is a ton of sugar, this is ton of sugar square, whatever it means. It's not really very convenient, right? So, we better have the square root of this to have the units exactly the same measured as the original. So, that's why it's square root. All right. So, basically that's it. We have calculated the expectation. It's p. We calculated the variance, which is this, and we calculated the standard deviation, which is this. Okay. Now, let me just give you a very simple example of this particular Bernoulli distribution. And I will not use the coin tossing, which is too easy. Let's use something a little bit more interesting. Let's say you are trying to guess the lottery numbers. So, you have a lottery, which is usually called 6 of 49, right? So, you have some kind of a ticket with 49 numbers from 1 to 49. You have to guess up to 6 numbers. I mean, you guessed 6, but up to 6 actually might be winning, right? And then somebody is choosing 6 numbers from some kind of a lottery device, whatever it is. And then there are certain numbers which are the same as those pulled from that device. And that's the winning numbers. And then there are some numbers you have chosen which are completely outside of that set. So, you might win 0, 1, 2, 3, 4, 5 or 6 numbers. So, let's basically simplify the story. Let's say if you have guessed correctly 4, 5 or 6 numbers, you win. This is a success. If 0, 1, 2 or 3, this is failure. Now, in one of the previous lectures where I was actually analyzing what the probability is all about, I have calculated the probabilities of hitting exactly a certain number of numbers from 0 to 6, whatever. So, if you will add the probabilities for these, you will get something like 1000s. So, with the probability of 1000s, you guess 4 or more numbers out of 6. Okay? And with probability of 0.999, you fail, too, basically. In this experiment, you have a failure. So, we are talking about winning or losing success or failure with a probability of success equals to 1000 and the probability of losing equals to 0.999000, right? So, it's a really very kind of a losing game, if you wish. Now, you probably want to play this game in such a way that it would equalize your winning, which means that in this particular case the winning should be equal to 1, but let's just have a unit of measurements sufficient enough to compensate the small probability. Let's say in 1000s of dollars. So, you win $1,000 in case you win. And in case you lose, you don't get anything. Also, $1,000, right? So, basically it's the winning game for you. Either you win or you don't lose. That's okay. In our case, this is just some kind of educational example. So, let's just calculate expectation and the standard deviation of this Bernoulli trials. Alright, so, what's the expectation? Okay, let me go back here. That's what we have derived before, right? So, the expectation of this game is equal to 0.001, but now I have to in 1000s of dollars, which is equal to $1, right? So, on average in this game, you will win $1. So, in 1000s, average 1000s of cases, you win $1,000, which means that in every game, on average, you will get $1. So, that does make sense, right? So, we are averaging, right? So, we are averaging, we play 1000s and 1000s of games, and on average, every 1000s of that number, we are winning $1,000. So, that's approximately $1 per game. So, that's okay. That's kind of obvious and intuitively you feel that this is the right answer. Now, let's talk about standard deviation, sigma. Well, that's in our case, it's square root of 0.001 times 999. That's where it is. And it's equal to, well, I calculated before, approximately, that's what it is. Am I right? Well, this is almost one, so it doesn't really matter, but if you will multiply 32,000 by 32,000, you will get approximately, well, a little bit less than 1000 over a million. So, yeah, it's about 1000. Now, again, this is in thousands of dollars, which means if it's in thousands of dollars, it's approximately, by the way, this is approximately, it's not equal, about 32 dollars, right? That's an interesting point, you see? The average is $1. That's your expectation, so average per game. So if you play millions of games, then an average you will be getting $1 from it. But the standard deviation is rather large. I mean, considering you have an average per game $1, it means that average deviation from this $1 can be really substantial. If the average deviation is 32, now you can have zero sometimes. Actually, in many, many cases, you will have zero. And in certain cases, you will get certain, you know, large sum of, large winning sum. And if you will average this deviation from $1 to the left, to the zero, or to the right, to some big number, and it's a weighted average, actually, you will get something like 32. So that actually gives you an idea that your winning can be, well, significantly different from your average. Well, basically that's it. That's all I wanted to talk about as far as Bernoulli distribution. You can just, yourself, you can address this coin tossing, which is a very easy thing. P and Q equal both to one-half and obviously the average's expectation is one-half and the standard deviation is also would be square root of one-half times one-half, which is one-half. Well, that's an easy case. In any case, I suggest you to read the comments, the notes to this lecture. It's like a textbook reading, basically. Just to familiarize yourself more, maybe, with terminology and basically ideas of how to calculate the expectation and the standard deviation. So that's it. Thanks very much and good luck.