 Hi everyone it's MJ and we're looking at question five of the September 2017 paper and we're dealing with confidence intervals as well as with hypothesis testing so let's get stuck into the question. It says in an election between two candidates A and B in a large district a sample poll of 100 voters chosen at random indicates that 55 percent were in favor of candidate A and the question is calculate a 95 percent confidence interval for the proportion of all voters in favor of candidate A based on the above sample. Now this is quite an easy question and why it's easy is because of the words that they're using they're telling us we need to calculate the proportion we've been given a percentage and we've been given the sample size so we have n and we have p and it's between two candidates A and B so in a sense we are looking at a binomial distribution which means binomial distribution if you've learned your formulas or if you're allowed to bring your formulas into your exam you have the following as your confidence interval we're getting 1.96 that's coming from the 95 part over there and the structure is as follows we've got p hat 1 minus p hat divided by n and now all we're simply going to be doing is putting in the values which is 0.55 plus minus 1.96 and we have 0.55 times 0.45 divided by 100 and we want to plus that we want to minus that so we're going to have our confidence interval of 0.4525 and 0.6475 okay cool and then this is part one and that is the answer the tricky part is or where people might have struggled is if they didn't realize that it was binomial I think figuring out that it's binomial is the hard part but the clue and this is which you look out for in exams if they're using the word proportion or if they're only giving you the p and the n it makes a lot of sense to use binomial so that is maybe the tricky part of it but the actual maths is very straightforward okay let's go on to question or the second part of the question a candidate is elected if they win more than 50 percent of the votes we want to test in which the alternative hypothesis is that support for candidate A is such that she will win the election okay so now they're telling us what the alternative hypothesis is write down the hypothesis for this test in terms of a suitable parameter so what we need to do here is we need to write the null and alternative hypothesis and what we're doing here is that the p is the proportion so this proportion here is linked to this 50 so what we can have we're going to have ho as our null hypothesis versus h1 which is our alternative and we've been told that the alternative is p greater than 0.5 because that is them winning the election such that she will win and that means that the null hypothesis is that p is going to be less than or equal to 0.5 I mean theoretically you could put a like as equal to 0.5 but it's nicer to do it this way because you're saying the null hypothesis is that she doesn't win the alternative hypothesis is that she does win so that should have been quite straightforward a nice easy mark this question here I think a few of you might have struggled with it says explain whether or not the confidence interval in part one can be used to test the hypothesis in part two at the five percent level of significance that is the big clue so while it is true that we can use confidence intervals to test our hypothesis or our hypotheses we cannot use this one in part one and the reason why we can't use part one is because we were using a two-sided test so we were using a two-sided test at five percent which means plus and minus we were having 2.5 and 2.5 on either side which means we can't use it because it is a two-sided test which means the one-sided would only be 2.5 percent and that is half the level of significance that we are looking for but like I said it was a bit of a difficult question because you kind of need to really appreciate the theory and the whole idea behind hypothesis testing and confidence intervals and that's one thing I must stress is statistics is not just a mathematical exam it is an exam that does require a little bit of deeper thought you need to understand why you do things rather than just how to do things anyway let's move on to the last part of the question which says it has been reported in the news that a new poll estimates support for candidate A at 52 percent with a margin of error of no more than plus minus 2 percent with confidence 95 determine the minimum size minimum size and what I like about the word minimum is that remember size has to be a whole number which means we're going to be rounding up because we didn't have the minimum of the sample of voters that was taken in this new poll so what we're going to be so this is part two let's look here at part three so in part three what we have is the following equation we have something with our 1.96 you know our p hat 1 minus p hat over our n and we want this to be equal to 0.02 okay if you're wondering where am I getting that remember over here this chunk this part over here is the width that we're adding to our confidence interval so we just want to look at the width of our confidence interval so that's where we're getting this here it's just the width and we've told that the width is equal to two percent now we have the p and that is 52 so we simply need to plug these in and our unknown is the n so we have 1.96 we're getting that from the five percent confidence so 0.52 0.48 our n is the unknown which is equal to 0.2 which means we want to get n on its own so it's going to be something like this um dividing it on these sides 0.02 divided by 1.96 squared because when you get rid of that square root and we see n is going to be equal to two three nine seven point one six and like I said it's a sample size we can't leave it like that it needs to be a whole number because remember this number represents people and you don't get 0.16 of a person which means our sample size should be two three nine eight so two thousand three hundred and ninety eight people is going to be the minimum sample size we need in order to fulfill this criteria and yeah there we're done it's it's quite interesting that this question was only with six marks normally these types of uh or this part of the the course does count for a lot more marks so make sure you are paying a lot of attention to this course anyway i'll see you guys for the other videos and as always if you've got any questions please let me know in the comment section cheers