In previous tutorial we discussed intervals, confidence intervals. In this tutorial, I'll discuss hypothesis testing. Hypothesis testing is actually the other side of the same coin. We're talking about confidence intervals, but from a slightly different perspective. So in order to say something about hypothesis testing, first of all, let's look at the distribution. Again, we are about to talk about distribution in the same manner we talked about distribution before. Again, we want to know how confident we want to be in our result. In other words, in rejecting or accepting hypothesis that we're proposing. But in order to do that, first of all we need to set up what is the hypothesis that you want to test, and we call this the null hypothesis. There are many kinds of hypotheses, and I'm sure that you already discussed most of them during your lecture. What I'm trying to show you now, is I'm trying to bring you some realistic example as how this hypothesis testing can be used. So there is a null hypothesis that is the main hypothesis that you propose, and there is an alternative hypothesis, the hypothesis that will be accepted in case the null, the original hypothesis of yours is rejected. So in this example, we'll talk about a soft drink company that produces a juice with certified centiliters. And you would like to know whether the machine is underfilling or overfilling the cans. Because we're interested in the difference from 32 centiliters in either direction, we will call this a two tail test. So in this case, we have a hypothesis to propose. So because we are interested in hypothesis that on average, that 32 centiliters in a can, this will be the hypothesis that we are proposing. The alternative hypothesis will say that we don't have those 32 centiliters in our can. The next step we want to do or we want to determine is how confident we want to be in our hypothesis. So let's take the same ideas we proposed before in intervals, and we will assume that 95 percent confidence is the one that we're interested in, and therefore, the critical value that will correspond to that again will be 1.96, which if you look at the graph of probability density function of the normal distribution, this will be the critical value. For the sake of this example, of two tail test, we will call that area an acceptance area. And I will explain in a second why this is the acceptance area. And this will be the rejection area. So now we have to collect 30 observations because we would like to test our null hypothesis with such observation of cans. So let's suppose we randomly pick in this factory 30 cans and measure the content. In the following table you see the content of 30 cans. So some of them are both 32 centiliters and some of them are below 32 centiliters. We can use this data to first of all compute the mean of the sample. And the mean of the sample is 32.5 centiliters if you compute the mean correctly. Another thing we have to do is to compute the variance or the standard deviation of this sample. In the same manner as we've done it before, if you compute the sample variance or the sample standard deviation, the standard deviation will be 0.128. The next step will be to construct the statistics that will determine whether we reject or whether we accept the null hypothesis. The way to construct the test for hypothesis will be to construct a z value which will be equal to, our estimator, point estimate, which is in our case the mean of sample x upper bar, minus the m which is the hypothesis itself that we propose, over sample variance of sample standard deviation divided by the square root of n. You already see some similarities between this and the intervals, confidence intervals. So the confidence interval for the sake of this example, if you remember, will be m equal to x upper bar plus minus z that corresponds to 95 percent confidence times sigma over square root of n. In the previous case, the sigma was known because we were given that. In that case, it is not known and therefore, we have to use an estimate of that by using the information that was provided in the sample. You see the similarity between this and this is quite striking. Now, moving to the next stage. We mentioned that the sample mean is equal to the 32.05 centiliters. We know what m is, is 32 centiliters. We know that this value, the standard deviation of the sample is equal to 0.125. And we know the sample size is 30. If we do the calculation correctly, the z value where we have is 2.139, which lies if we take this distribution in this region to 2.139. Because it is in the rejection area, we will have to say that our null hypothesis is rejected, and therefore we accept the alternative hypothesis. In other words we say, that our null hypothesis is that average of cans is 32 centiliters is incorrect with 95 percent confidence, and the alternative is the correct. But it's very important to understand what alternative means. It means that we do not know whether it is greater or less. It can be either.