So the author purchased a slot machine and tested it by playing it 1197 times. He recorded his results in 10 10 different categories of outcomes, and he wants to test a claim that the actual outcomes agree with the expected frequencies. So we're going to run a hypothesis test to test this claim. So in order to do that, we will have to generate a hypothesis and we always generate are no hypothesis based on the observed data fitting or agreeing with the expected data. So therefore, our claim will be our null hypothesis, and our alternative hypothesis will be that the actual outcomes do not agree with the expected frequencies. And any time we want to compare or test whether observed data fits what is expected, we run a hi square goodness of fit test, which then we'd have to find a Chi Square test statistic. And there is a formula for this, and the author has already calculated it, and he or she has calculated out to be 8.185 so we then need to calculate a P value, and the P value is the probability that your chi square is greater than that test statistic. And in order to calculate that, I always recommend taking a look at what the graph would look like. So we are running a chi square goodness of fit test. So we're going to draw a chi square graph, which is a skewed right graph, and the shape of the graph is dependent on the degrees of freedom. And we find degrees of freedom by calculating K minus one, and K represents the number of categories that you're going to separate your data into. So if we go back up here, we were already told that the author separated his data into 10 categories. So therefore, R K value is 10, making our degrees of freedom to be nine. Now. Not only do the degrees of freedom give us the shape of the graph. It also gives us information about the average or the mean of the chi square distribution. So the mean is also going to be nine. Now, on our Chi square distribution graph, the mean can always be found slightly to the right of the peak. So we now know there's a nine right here on our chi square axis and for us to find the P value we're trying to determine what's the probability that Chi Square is greater than 8.185 So we're trying to find this shaded region. In order to find that shaded region, we will use our chi square cumulative density function from our calculator. And the cumulative density function requires you to input information about the lower boundary of the shaded area, the upper boundary of the shaded area as well as the degrees of freedom. So our lower boundary of this shaded region is the 8.185 and the upper boundary. Keep in mind that that curve continues infinitely to the right, and as we keep going, the tail is getting smaller and smaller. So envision a very large number out at the end of that tail. So we're going to use 10 to the 99th Power, and our degrees of freedom is nine. So I'm going to bring in the graphing calculator and show you where you can access the Chi Square cumulative density function, and we'll access it by hitting the second button and the bears button. And it's number eight on this menu. so are low. Boundary is 8.815 are upper boundary is 10 to the 99th Power and are degrees of freedom was nine. So our P value for this hypothesis test is going to be Let's let's change that. I noticed I have a typo, so we want to do 8.185 not 8.815 and then tend to the 99th in our degrees of freedom or nine. So we end up this time with the correct value of 515 six. So that is referring to this area that is shaded. So that's our P value. Now, when you run a hypothesis test, you can also find a critical value, and our critical chi square value can be found by looking in the table in the back of your textbook so you would go to the Chi Square distribution table. And it does records some information about degrees of freedom down the left side and your level of significance across the top. And we're running this hypothesis test at a level of significance or an Alfa of 0.5 So in your table across the top you're looking for 0.5 and down the side you're looking for nine and where those to meet up would be your critical chi square value and you get 16.919 So now it's time to make a decision based on the components of this test And to make your decision, we could do one of two things We can either use RPI value or we can use our chi squared critical value. If you decide you're going to use your p value, then you want to ask yourself if Alfa the level of significance is greater than the P value and if it is, then your decision will be to reject the null hypothesis. So our Alfa is 0.5 and our P value was 0.5156 So, as you can see, our Alfa is not greater than our P value. So our decision then will be fail to reject the null hypothesis. Now, the other way we can make this decision is by use using that critical chi square value. And again I like to draw a picture and what I I would like to do is to place that critical value that 16.919 on the curve. And by putting that on the curve, you have now separated your curve into two regions. The tail would be classified as your reject H O region, and the other side to the left of that critical value is going to be your fail to reject the null hypothesis region. And then you would go back up and look at your test statistic, and our test statistic was already pre calculated to be 8.185 So you'll come back here and on this chi square access. You'll also plot that value, and since 16 is here, then the test statistic would be approximately here at eight point 185 and that value is falling in the fail to reject the null hypothesis region. So our decision, no matter which method we use, is to fail to reject the null hypothesis. So therefore, let's go back to our hypotheses. If we fail to reject the null hypothesis, that means this is a viable option. It's not definitive. Our data is not conclusive that it definitely happens, but we can't throw it out either, So the data is inconclusive for us to rule that out, and if we don't rule that out, then we can't rule out this claim either. So therefore, our conclusion is that there is insufficient evidence to reject the no hypothesis. Thus, there is not enough evidence to reject the claim that the observed outcomes agree with the accepted frequencies. So since we're not rejecting the claim, we could then say slot machine appears to be functioning as expected and that concludes your hypothesis test.