Suppose we're looking at a two-candidate mayoral race in Providence. Candidate A is declared winner with 55 percent of the vote (p(hat) = 0.55). However, candidate B is suspicious of these results. Having his group of close friends take a random sample of 17 voters from Providence, he finds that 7 voted for candidate A while 10 voted for him.
On the basis of this study performed at the alpha = 0.05 level of significance, should candidate B demand a recount?
Formulate the null and alternative hypothesis and perform the test in order to respond to this question.
For hypothesis testing, I only know how to solve these problems if we have 4 parameters: Xn the sample mean, u the population mean, sd the standard deviation and n the sample size. But here I don't have the sample mean nor the standard deviation. What is the formula used to find the normal distribution t given a 95% confidence interval when doing hypothesis testing when n is not large? Since we don't have the sample mean nor the standard deviation, what is the process of hypothesis testing here?
H0: u = 0.55
H1: u < 0.55 since p = 7/14 = 0.41
z = p(hat) - p / sqrt(p(1-p)/n) = 0.55 - 0.41 / sqrt(0.41(1-0.41)/17) = 1.17
p(z < 1.17) = 0.879 p(z > 1.17) = 1 - 0.879 = 0.123
Since 0.123 > 0.05, we don't reject the null hypothesis and candidate B shouldn't demand a recount.
Is this correct?
The question might be more suitable for stats.stackexchange.com, but I'll write an answer anyway.
Note that the core question of hypothesis testing is: what is the probability of finding this, or an even more extreme, result when the Null hypothesis is true.
First Question: what is the Null hypothesis?
Answer (spoiler alert): that 55% of the population in the state is in favour of candidate A.
Second question: you are talking about probability so where is the randomness? What process in this story can be modeled as 'drawing from some probability distribution'? This is the crucial question you should always be asking yourself.
(Think about it for a bit...)
....
....
Ok the answer is: selecting these 17 random people. This is the only place where something random happens.
So what we see here is: we randomly select 17 people and each time you randomly pick someone you have, independently of what you saw before, 55% chance of this person having voted for candidate A. (Assuming that the Null hypothesis is true)
Third question: what was it that we wanted to calculated again? Answer: the probability of finding at least 10 B-voters among the 17 randomly selected voters
So the question you want to answer is equivalent to:
You have a crooked coin that lands heads 55% of the time. You throw it 17 times, what is the probability of it landing on tails at least 10 times.
Or:
You have an urn with 55 red balls and 45 blue balls. 17 times you blindly pick a ball, look at its color and throw it back. What is the probability of finding at least 10 blue balls.
These are the type of question one usually encounters in school way before learning about normal distributions or hypothesis testing at all. Thus I am confident that you can solve it.
(Side note: I side-stepped the question of confidence intervals, jumping directly to the $p$-value. We can talk about confidence intervals if you like, but it is slightly more complicated. Also the 7/17 is the sample mean. Imaging giving every voter a value of 1 if they voted for A and 0 if they voted for B. We want to test the hypothesis that the population mean is 0.55 given the sample mean of $0.41$ and the fact that these are independent Bernouili trials)