We want to use a hypothesis test to test a claim of lottery officials that the digits for the California's daily for lottery are selected in a way that they are equally likely. So to test that claim, we had to first gather data, and over a period of 60 days, the distribution of digits was recorded, and over that 60 days, there were 21 incidences of zero. There were 30 ones. There were 31 twos. There were 33 threes. There were only 19 fours. There were 23 fives. There were 21. 6 is there were 16 sevens, 24 eights and 22 nines. And since it was a period of 60 days and they were drawing four digits each day, the some is going to be 240. Now. These air what we call observed data and in order to run a hypothesis test, the first thing we have to do is generate our hypothesis, and your hypothesis is always a statement of equality, and the claim is exactly that digits air selected in a way that they are equally likely. So we're saying that there are is the chance that they would all be the same number of or appear the same number of times. Now the alternative to that would be the digits are not equally likely to be selected. So what we're going to need to do is we're going to need to run a goodness of fit test. And we want to see how good our observed pieces of data fit what we would expect. And in order to runny goodness of fit test, we need a Chi Square test statistic. And to calculate a Chi Square test statistic, we would use the formula, the sum of observed minus expected quantity squared, divided by expected. So we're going to go back up to our chart and we have observed pieces of data. So now we have to generate expected pieces of data. And if they had an equally likely chance, then we would expect all of the frequencies to be the same. There were 240 different digits over the 60 day period. If we divide that by the possible 10 digits that could happen or occur, then we would expect 24 zeroes and 24 ones, 24 twos and so forth. And now we need to calculate our Chi Square test statistic and calculate our Chi Square test statistic. We're going to expand our chart to include a column called O minus E Quantity squared, divided by E. So we're taking the observed value minus the expected value they were doing 21 minus 24 were squaring the result and then we're dividing by 24. Now, the fastest way to generate this list would be to bring in our graphing calculator. So when I bring in our graphing calculator, you could see that I have all the observed values Enlist one and I have all the expected values enlist to. So we're going to sit up on top of list three and we're going to type in a parentheses. We're gonna say, Take all of the values from list one. Subtract all their corresponding values, enlist to square that result and then divided by all the expected values enlist to, and we will get the following values. So we're going to record them for the sake of just recording them on your paper. I'm only going to take them out to three decimal places, but I am going to leave all decimal places in the calculator. So on your paper we would now record the values and those values again would be 0.375 1.5 about 2.42 3.375 one point 042 0.42 0.375 2.667 zero Which we would expect because they were the same and 0.167 now to find that Chi Square test statistic, we needed to sum up this column and again, the fastest way to sum up that column would be to bring in our graphing calculator, where those digits are housed and notice they are in column three. So we're going to quit out of the table, and then we're going to hit Second Stat and scoot over to math and tell the calculator to please some up list three. And our Chi Square test statistic for this data would be 11.583 Now, when we run a goodness of fit test, not only do we need a chi square test statistic, but we could utilize a P value or a critical chi square value, so I'm going to show you both ways. So the first thing we're gonna do is we're gonna find our P value associated with this data. And the P value is asking you for what the probability is that your chi squared would be greater than the test statistic that we just found. And to get a handle on what that means, oftentimes it's best to draw a picture. So we're doing a chi square goodness of fit test. So we will need a chi square distribution graph and chi square distributions are, for the most part, skewed to the right, and the set up of the peak of that skewed right graph is dependent on our degrees of freedom. And our degrees of freedom is found by doing K minus one where K represents the number of categories that you have separated your data into. So since this was counting the digits and we categorize the digits from zero through nine, there were 10 different categories, so our degrees of freedom would be 10 minus one or nine. Now, not only is that the degrees of freedom, but that's also the average or the mean of this distribution, and you will always find theme mean slightly to the right of the peak. So this horizontal axis is our chi square axis, and we are trying to determine the likelihood or the probability that Chi Square is bigger than 11.583 So we're trying to find the area between the curve and the horizontal axis where we are greater than 11.583 And the easiest way to come up with that P value is to use your chi squared cumulative density function that's in your calculator, and it will require you to right the lower limit of the shaded area, the upper boundary of the shaded area and the degrees of freedom. So for our problem, we have a lower boundary of 11.583 the upper boundary. We have to keep in mind that that horizontal axis continues indefinitely. So when we pick an upper boundary, we're going to pick a very large number. Let's do 10 to the 99th power, and then our degrees of freedom would end up being nine. So I'm going to show you where you can find that cumulative density function again. I'm going to bring in that graphing calculator. I'm gonna clear what's on our home screen. For the moment, we're gonna hit the second key. We're gonna hit the variables button, and it would be number eight in the menu that you see. So we're going to again put in our chi Square test statistic as our lower boundary 10 to the 99th as our upper boundary. And our degrees of freedom was nine. So we find a P value of point 237 eight five. Now, keep in mind with that ISS that represents the area of this shaded region to three 785 So we're saying about 24% of the curve is in that shaded region. So that is our P value. We're ready to talk about the critical chi square value and to find our critical chi square value, you're going to look in the Chi Square distribution chart in the back of your textbook and down the left side. It talks about the degrees of freedom. So we're going to look at nine and across the top. It talks about your level of significance, and we're going to run this hypothesis test at a level of significance or an Alfa value of 0.5 So you're going to look up 05 in the chart. And when you do that across from the nine, you're going to find a chi square critical value to be 16.919 Now, when it comes time to actually finalize your hypothesis test, we can do it one of two ways. We could either use the P value or we can use the critical value. There's no need to do both. I'm going to show you both, but there's no need to do both. They're both going to end up in the same, um, decision. So when or if you're using your P value, you're going to compare your level of significance to that p value. And if Alfa is greater than the P value, then the decision will be to reject the null hypothesis. So in our data we had an Alfa of 0.5 We had a P value of 0.23785 So therefore, our Alfa is not greater than RPI value, so therefore we're going to fail to reject the null hypothesis. So that's one way to come up with our decision. The other way is to utilize the critical value. So we're going to draw a chi square distribution and we're going to label the critical value. So the critical value we found to be 16.919 so that critical chi square value is going to separate the curve into two regions. One of the regions were going toe identify as the fail to reject region and in the tail of the curve is going to be your reject, the null hypothesis region and what we're going to do is we're going to compare our test statistic to the critical value. And if we go back and grab our test statistic, our test statistic was this. 11 0.583 and 11.583 If I were to plot it on, that curve would end up falling back here. And since it fell in the failed to reject region again, our decision would be fail to reject the null hypothesis. So again, you would either do a comparison between your level of significance in your p value or do a comparison between your test statistic and your chi square critical value, either way you approach it, you do end up with the same decision. So now that we have decided on failing to reject the null hypothesis, it's time to draw our conclusion. So based on this data, there is insufficient evidence to dispute the claim of the lottery officials that the digits are selected in a way that are equally likely. So they're claiming it. We don't have enough evidence to say it's not true, so there's insufficient evidence and that concludes your hypothesis test.