 Hello again. In today's lecture, we will be looking at few typical problems involving discrete probability distributions and cumulative probability functions. It is suggested that you read the problem statement and try to solve the problem on your own. And if your answers are correct, well and good, you have understood the course material. Otherwise, please look at the solution which will also be provided in this lecture and compare it with your answers. You can find out where you made the mistake, okay. It is not a one-way street. There may be even a mistake in my calculation, but I have checked it a couple of times. So I am pretty sure that these problems are error free, okay. So the first example is a simple derivation, okay. We know that the expected value of x is equal to mu, the mean value, okay. And the variance of the random variable x is equal to sigma squared, right. So do not put sigma here. Sigma means standard deviation and sigma squared means variance. Square root of variance is the standard deviation. So you have to show that the variance is equal to the expected value of x squared-mu squared, okay. The value of E of x squared need not be equal to E of x whole squared, okay. You should not confuse this with E of x whole squared, okay. E of x squared is different from E of x whole squared. Now we know by definition the expected value of x-mu whole squared is equal to sigma squared. What we will do is, we will take the left-hand side of this equation and expand it. A-b whole squared is a squared-2ab plus b squared. So you have expected value of x squared-2xmu plus mu squared. And then we take the expected value term by term. So we get E of x squared-2 mu E of x plus mu squared. You may be asking, wait a second. What is this E of mu squared? How did you write mu squared? The expected value of a constant is a constant, okay. So we can write expected value of mu squared as mu squared directly. And that also enabled us to take out the 2 mu when we put the expected value or applied the expected value on 2x mu. So the 2 mu came out and we simply had E of x, okay. Now this is the question which is being repeated here for your convenience. So we end up with E of x squared-2 mu E of x plus mu squared. Repeating what I said a bit earlier, the expected value of a number or a constant is the same number or a constant, okay. Now if you look at this, expected value of x is equal to mu. So we can put mu here and we will get E of x squared-2 mu squared plus mu squared. That is what I have shown in this slide. You can see that it is E of x squared-2 mu squared plus mu squared which leads to E of x squared-mu squared. So the expected value of x squared is equal to sigma squared plus mu squared, okay. Let us see the next question. If E of x is equal to mu which we know very well and V of x is equal to sigma squared, how will you find E of x squared, okay. The solution is if you are already having the mean and variance with you, you can use the result from the previous example and take it as E of x squared is equal to sigma squared plus mu squared, okay. Since sigma squared and mu squared are already available, you can just add them up and then say that expected value of x squared is the sum of these two, okay. However, that is one way of doing it, okay. Anyway, if those values, these two values are not available to you, then you have to do some calculations and find mu squared and sigma squared, okay. I am going to show you how to find E of x squared independently. So rather than doing somewhat or relatively tedious calculations for sigma squared, what you can do is you can first find out E of x squared. You already know or you can calculate mu squared rather easily and then you can subtract mu squared from E of x squared to get the variance sigma squared, okay. So let us see the calculations. An independent way to find out E of x squared is to use the definition of E of x squared which is nothing but sigma, the summation going from i equals 1 to n xi squared f of xi, okay. Now, let us go to the third example where we will numerically calculate the mean variance and the expected value of x squared, okay. So you are given the probability mass function, okay. The random variable x, capital X can take these 6 values, 0, 1, 2, 3, 4 and 5, okay. These are discrete values and please note that these are the only permitted values of the random variable. You cannot have a value like 0.5 or 1.5, okay and this is f of xi. f of xi if you recall is the probability of the random variable taking the value 0, okay. For this particular case f of xi is 0.1, okay and in general f of xi is the probability that the random variable takes the value xi. xi can be in this case any number involving 0, 1, 2, 3, 4 and 5, okay. So among all these cases you can very easily verify that the probability values are not the same, okay. 0 is having 0.1, 1 is having 0.05, 2 is having 0.3 and so on, okay. So whenever you are given problems like this, the first thing you should do is to see whether the problem is correct, okay. That is very important, okay. We can still carry out the routine mathematical exercises and give the answer but there may be a printing mistake or there may be a genuine mistake and the problem itself may be erroneous, okay. So we have to check the problem and see whether the statement is correct and the data given are correct. The first check you have to make here is to see whether the probabilities all add up to 1. So I have given the table again and these are the probability values or f of xi values and when I am adding these values I get 1. The numbers are not too difficult. So I can even add it up manually, 0.1 plus 0.05 is 0.15, 0.15 plus 0.3 is 0.45, 0.45 plus 0.4 is 0.85, 0.85 plus 0.1 is 0.95 and 0.95 plus 0.05 adds up to 1. Good. So there is nothing wrong in the given probability distribution. So the question is correct. Now we can go ahead and find the other statistical parameters like the mean, variance, standard deviation and the expected value of x squared. You might recollect that I told you that there are 2 different ways to find E of x squared. First way is to do in the following manner. You can calculate mu squared. You can also calculate sigma squared, add the 2 and get E of x squared. That is one way of doing it. Another way of doing it is to multiply f of xi with xi squared okay and then add the total sum will give expected value of E of x squared okay. So let us do it in both the ways. So this is your table. Now you can set up the problem and its data in a suitable spreadsheet. The data is given here. The first column contains the xi values. The second column is the column of probabilities. You can see that the sum of the probabilities is equal to 1 and then I find xi f of xi okay. The purpose of doing that is to find the mean. Now what you have to do is find out xi f of xi right. Please note that sigma xi f of xi will not be equal to 1 okay. Only sigma of f of xi will be equal to 1. Sigma of xi f of xi will be equal to the mean okay. The average value of the given discrete probability distribution. So you can see that I multiply 0 into 0.1. I get 0, 1 into 0.05, 0.05, 2 into 0.3, 0.6, 3 into 0.41, 0.2, 4 into 0.1, 0.4, 5 into 0.05, where sigma xi f of xi. You can directly do the summing from the spreadsheet. Otherwise you can do it manually for the simple case 0.65, 1.85, 2.25 plus 0.25 is 2.5. So the average or mean value is 2.5. Now you have to calculate the expected value of x squared which means you have to find E of x squared. So what you do here is you take the square of xi, xi squared into f of xi. So 0 squared into 0.1 is 0, 1 into 0.05 is 0.05, 4 into 0.3 is 1.2, 9 into 0.4 is 3.6, 16 into 0.1 is 1.6, 25 into 0.05 is 1.25. When you add this up it comes to 7.7 and this is the expected value of x squared. Now to calculate the variance, you have to find x of i-mu whole squared into f of xi. What you are doing is find the deviation of the x of i value from the mean value, square it. So you have to find 0-2.5 that means it is – 2.5. When you square it, it will become 6.25 and you multiply it by 0.1, it becomes 0.625. Then 1-2.5 is – 1.5. So – 1.5 into – 1.5 is 2.25. That you multiply by 0.05, you get 0.1125 and then you do 4 – 2.5 that is 1.5 okay and square of that is 2.25 and then you do with multiplied by 0.3. Similarly, you can do it for all the other values. I will just pause a moment to do some calculations here. 2-2.5 actually I made a mistake okay. It is not 4-2.5 that is a mistake. It is 2-2.5 which is – 0.5. So – 0.5 squared will be 0.25 and then 0.25 into 0.3 is 0.075 okay. So these are some typical mistakes you can make when you are doing hand calculations. These mistakes are unlikely when you do the calculations directly in the spreadsheet cutting and pasting the formula in the cells. Similarly, you can do 3-2.5 is 0.5, 0.25 into 0.4 is 0.1 and similarly you can get the other values. So the total sum of the squared deviations multiplied by the respective probability distribution values is 1.45. This is nothing but the variance. The sum is the variance okay. So summarizing the values we have got, we found the mean to be 2.5. The variance we found from the previous example is 1.45. The expected value of x squared from the previous example was 7.7 and we can also cross check whether this variance of x, okay. This variance of x is equal to 1.45. This is from the direct method. Again you can see that there is a mistake here which I will correct now, right. So earlier this f of xi was missing. Now I have put variance of x is equal to sigma is equal to 1 xi-mu whole squared into f of xi that is coming to 1.45. When you cross check it, you can see that variance of x is again coming to 1.45 when we subtract mu squared from E of x squared. We get E of x squared as 7.7-mu squared 6.25. So 7.7-6.25 is 1.45. The standard deviation will be the square root of the variance and square root of 1.45 is 1.204. The results are nicely summarized in the form of a table here. The parameter is mean E of x squared variance of x of sigma squared and sigma. The formula is also given here. Again you have to make a correction here. So you can see that it is sigma is equal to 1 to n xi-mu whole squared into f of xi and for that we got a value of 1.45, okay. So these are the results for the different parameters and they are summarized in this table. Now we go to an interesting problem. You are having E of x is equal to mu and variance of x is equal to sigma squared. So you have to find out the expected value of E of x-mu cubed. So I hope all of you remember what is A-B whole cube, okay. A-B whole cube is A cube-3A squared B-3AB squared-B cube. So using that instead of A and B we put x and mu, x-mu whole cube is x cube-3x squared mu-3x mu squared-mu cube. So we have to again apply the expectation on this x-mu whole cube. We get E of x cube-3 mu E of x squared-3 mu squared E of x-mu cube. Please recollect that when you apply the expectation on a constant or a number then you get the same constant or the number, okay. Only for a variable, a random variable you have expectation of that x having a non-constant value. You have to do some mathematical calculations with that, okay. Once you are given the random sample and you are given the data then you can find the appropriate expectation. So as of now we are not given any data, we are only given x-mu whole cube and we have to find the expectation, okay. So to summarize we get E of x cube-3 mu E of x squared-3 mu squared E of x-mu cube. We do not want to leave the result here because there is some possibility of further simplification. So you know that the expected value of x squared is equal to mu squared-sigma squared. We saw that in one of the previous examples. That is what is summarized in this table here. So you have expected value of x is equal to mu. Expected value of x squared is equal to mu squared-sigma squared. So in this E of x squared you substitute mu squared-sigma squared-3 mu into mu squared will become-3 mu cube that will cancel out with this 3 mu cube and you will be having E of x cube-3 mu sigma squared-mu cube, right. Now we come to a quite an interesting problem. I set up the problem myself. You can see whether you can do it on your own. You may want to pass and then do the problem yourself. Even the previous problems I created my own data and the rest was routine. You have to just do the numerical computation. The one involving E of x-mu whole cube is a standard result, okay. For example, Oganaigase random phenomena book has it as an exercise problem, okay. So now if you look at this problem, the first subdivision states identify the general form f of x, okay. You want to give a mathematical expression which will describe this given data, okay. When x is equal to 1, the probability distribution takes a value A. If it is 2, it takes a value A to the power of 2. If it is 3, it takes the value A to the power of 3. So the general form of x is easy to identify. It is simply A to the power of x where xi values can be 1, 2 and 3, okay. The second question or the second subdivision states that what is the allowed value of A if the above satisfies the criteria for probability mass function, okay. So we have to determine a value for A, okay using the conditions that need to be satisfied for a probability distribution function, okay. Identify the general form of f of x as it said short while earlier f of x is equal to A power x, okay. A, A squared, A cube. So this exponent is matching with the x value, so it becomes A power x, okay. So the important condition that needs to be satisfied for this function to be a probability distribution function is the sum of the probabilities should be equal to 1. There is another criterion that these f of x i values should be positive, okay. So we will see if both these conditions are being met. So what we have to do is sum the f of x values over all the possible values of x. So A plus A squared plus A cube that should be equal to 1. So what is the value of A which will satisfy this equation? It is a geometric series. So you may want to take the summation formula and do it, okay and you will get A into 1-A whole cube by 1-A. It is a more compact expression, okay and you have to find the value of A such that this equation will become equal to 1. You cannot put A is equal to 1 because then this summation expression will blow up, okay. You may think of expanding 1-A cube, okay. You know 1-A cube can be expanded into 1-A into 1 plus A squared plus A or to put it in another way 1-A whole cube can be expanded into 1-A into 1 plus A plus A squared, right. So the 1-A will cancel out and you will have again A plus A squared plus A cube. So we are back where we started. In fact there is no need for us to take the summation of A using a geometric progression, okay. We could have directly taken this as the equation and try to solve for A such that this equation satisfies the constraint that the 3 terms should add up to 1. So we do not really need to take this, do the summation and take the summation. So it is not really necessary. Now there are various ways to skin the cat. The first way is to simply use trial and error. You do not know where to start, okay. Obviously the value of A is likely to be between 0 to 1. If you put A is equal to 0, you get the sum to be 0 and if you put the value of A to be 1, the sum becomes 3. So you are ranging between 0 and 3. You want to find the value of A such that the sum is equal to 1. So you can do trial and error or you can use Newton-Raphson method or you can use appropriate algorithm in MATLAB, okay. And eventually we find the root as reported in one of the softwares as 0.543698. We do not really need all these decimal values. You can report the answer as 0.5437, okay. So after finding this root, we need to do a check. What you need to do is take the obtained value and plug it back into the equation you are trying to solve and see whether the equation is satisfied with this identified value. So what you may want to do is take 0.5437, then square it and cube it and add all these 3 numbers and see whether the answer comes to be 1. In our case, this answer would be around 1.000 and some decimal numbers which is pretty close to 1. So we have identified the value of A to be 0.5437 and then what we can do is instead of giving the value as A, A squared and A cube, we can directly enter the value of A and then give the actual numbers. Let us do the next example. Here we are going to do an example involving the cumulative distribution function, okay. So the problem statement is like this. You are having different intervals of x, okay and then the cumulative probability distribution function value is also reported for each of these intervals, okay. Now the first interval is x is less than minus 5 and the f of x value which is the cumulative distribution function value that is equal to 0. Then you have the interval minus 5 less than or equal to x less than 1. You have the cumulative distribution function value to be 0.25 and then you have 1 less than or equal to x less than 2. The cumulative distribution function value is 0.5. Then you have 2 is less than or equal to x less than 5. The cumulative distribution function value is 0.75 and then 5 less than or equal to x 1.0. So one thing you may notice about this interval is it is involving no equality sign. It is only x less than minus 5. Then the next interval is having minus 5 less than or equal to x less than 1. So you are having less than or equal to here. Then you have 1 less than or equal to x less than 2. 2 less than or equal to x less than 5. 5 less than or equal to x, okay. So in the last 4 intervals you are having the first as the less than or equal to sign and then the other part is not having that equality contribution. It is just directly less than less than less than for the 3 intervals, okay. Just an observation. So now we want to sketch this distribution plot of f of x versus x, okay and then find the probability mass function from the given data. We are given the cumulative distribution function. So we need to extract the probability distribution function from the given cumulative distribution function, okay. As I told earlier, we need to check whether the problem statement is correct, okay. We are not making any mistakes such as putting capital X here, okay. So you cannot put capital X here because capital X is the abstract random variable and once the data is available it takes a value small x, okay. That is something which we have to watch out for. It is also f of small x here. This is a very interesting diagram. You can see some lines with some headers and footers or you may want to call it as a tail and a head. The head is sometimes a hollow circle or it is a full circle, okay. That is because the cumulative distribution function takes the value of 0 until x less than –5, okay. At x value of –5 it takes the value 0.25 and continues to take that value until it reaches 1 and once it has reached a value of 1 it jumps to 0.5, okay. So this is the cumulative distribution function having a value of 0 and at –5 there is a discontinuity. The function is not continuous. If the function was continuous, the value of f of x whether you approach a value either from the left or from the right should be the same but there is a discontinuity here. The function value when you are approaching –5 from the left is 0. If you are approaching –5 from the right it is 0.25. So this is a inevitable discontinuity at –5 and all the other points where the interval switches, okay. So at –5 and up to 1 the cumulative distribution function takes the value of 0.25 and then it jumps to 0.5 until you reach the value of 2, okay. So it takes the value of 0.5 until you reach the value of 2 and once again there is a discontinuity at the value of 2 and the functional value jumps from 0.5 to 0.75. So up to –5 it is 0. At –5 it jumps to 0.25, it goes up to 1 and then takes another jump. So there is a discontinuity here, takes a value of 0.5, goes to 2, there is a discontinuity here, it takes a jump, it goes to 0.75 and then it goes all the way up to 5 where it takes another jump and reaches a value of 1 at which point it saturates, okay. Cumulative distribution function is the sum of the probabilities and once you have reached the end of the permitted values for the random variable x, then you should have reached 1, okay. So there is no further change or jumps or discontinuities beyond this point, okay. Now the next step is to retrieve the probability distribution function, okay and how to do that. So you can see that the probability mass function or the probability distribution function is defined at –5, 1, 2 and 5, okay. So the permitted values of the random variable x are –5, 1, 2 and 5. At each of these values the probability is 0.25, okay. You can see that whenever we reach the assigned value for the random variable, the jump occurred by 0.25 units. So from 0 you went to 0.25 that means the probability value corresponding to –5 is 0.25. Since you are adding the probabilities when you went to 1 the probability value is again 0.25 at 1 because you are going from 0.25 to 0.5. The difference is 0.5-0.25 which is again 0.25. So at 1 the probability is again 0.25, okay and the total sum is 0.25-0.25 which is 0.5 and that is what you are shown here. And when you go to the value of 2 there is a jump to 0.75. So from 0.5 you have gone to 0.75 and increment of 0.25 and that is the probability value at x is equal to 2. Similarly at the x value of 5 the probability is again 0.25, okay. In this particular example it is clear that all the values of x have equal probabilities, okay. You have 1, 2, 1, 2, 3, 4, okay. You are having 4 values of x-5, 1, 2 and 5, okay. 1, 2, 3, 4. Each of them is having a probability value of 0.25. So when you add 0.25 4 times you get 1. So the sum of f of x is equal to 1 as it should be. Now let us go to the 7th example, okay. You have to prove that the variance of a constant is 0 and the variance of a linear combination of random variable in this case it is a simple linear combination Ax plus b, okay. For the particular case of variance of Ax plus b you have to simply show that it is equal to a squared variance of x. This is an important result we will be frequently encountering it in our course. First let us go to part a. Variance of a constant is 0, okay. So the variance of b by definition is expected value of b-mu whole squared, okay, where mu is equal to expected value of x. For a constant b expected value of b is equal to b, okay. So you have expected value of b-b whole squared that is equal to 0. In this case the x is taking a value of b, okay. So expected value of b-b whole squared is equal to 0. Let us go to the next part, variance of Ax plus b is equal to a squared variance of x. So we use the definition for variance again, expected value of instead of x we have Ax. So we just put Ax here Ax-mu whole squared where mu is equal to expected value of a of x, okay. So expected value of a of x is nothing but a times mu. So we have variance of a of x is equal to expected value of a of x-a of a into mu whole squared, okay. So we can take within the bracket a is common. So you can take a outside. So it becomes a squared when you square it, a squared into x-mu whole squared. You can take a squared outside the bracket. And so you have a squared into expected value of x-mu whole squared which is equal to a squared into variance of x, okay. This is an important result which we will apply frequently. So this concludes our session on example problems involving discrete probability distributions. We will not be extensively using these discrete probability distribution functions, okay. Because in our real life problems, we assume the random variable to be continuous, okay. And when you have continuous distributions, instead of calling it as the probability distribution function, we call it as the probability density function, okay. And in the discrete probability distribution cases, we were using the sigma notation or the summation symbol, okay. When you go in for continuous probability distributions or the density functions, you will be using the integral sign, okay. There is a lot of use in the discrete notation also. Sometimes when you are not able to do the integration analytically, you may want to do the calculations for finding the integral using numerical schemes. And these numerical schemes involve the summation of different quantities. So even though we are not going to use the discrete probability distributions that much, it forms the necessary background for the next step. That is the continuous probability distributions, okay. There also we have the expected value of the x squared variance of ax and so on, okay. These are just illustrative problems. You can find a lot of problems in the reference book I mentioned by Montgomery and Runger. These problems also have answers, okay. The odd numbered problem answers are given if I remember correctly. So you can work out some of these problems and gain practice, okay. The advice is do the problems even if it appears to be simple, probably by hand, okay. And then you can also verify your hand calculations with the spreadsheet calculations, okay. Oftentimes when you are doing statistical analysis of data, there may be a silly mistake creeping somewhere, okay. And sometimes when the mistake is made at the very beginning of your data processing, it becomes difficult to detect at a later stage. And sometimes your results may not be as you expect just because you have calculated the mean wrongly or the variance wrongly, okay. And the current trend is to go in for softwares, okay. Many softwares are available, I mentioned Minitab, okay. But these kind of hand calculations are essential so that you appreciate the significance of various parameters, okay. And you really have a feel for what they really mean, okay. So to summarize, do as many problems as your time permits. Make sure that whatever you have done, you have done correctly and cross check with the answers. We will go to the next lecture session from now.