# Hypothesis Testing - Binomial Distribution

#### craig

Hi, been looking over my Hypothesis Testing notes, and can't seen to find anything about testing the Binomial. For example a recent question read something like this.

A coin was tossed 20 times, with 16 tails and 4 heads. Let $$\displaystyle Y$$ be the number of heads thrown. How would I test this?

Guessing you'd start off with something like:

$$\displaystyle Y - Bi(20,p)$$

$$\displaystyle H_0: p=0.5$$

$$\displaystyle H_A: p \neq0.5$$

Not sure how to procede from here, if I was testing a Normal Distribution I'd calculate a p-vaule, just not sure how to do it for the Binomial.

#### craig

Just found something online that's similar to what I'm looking for.

What they did was to calculate $$\displaystyle P(Y \leq 4) = 0.00591$$.

How ever because a value of 16 heads would count against $$\displaystyle H_0$$ just as much, then we must also take into account $$\displaystyle P(Y \geq 4)$$.

$$\displaystyle P(Y \geq 4) = P(Y \leq 4)$$ because of symmetry, so the p-value is $$\displaystyle 2(P(Y \geq 4)) = 0.0118$$.

This indicates good evidence against $$\displaystyle H_0$$, ie. evidence against the coin being fair.

Does this look ok?

#### pickslides

MHF Helper
I was going to suggest finding $$\displaystyle \text{C.I}_{0.95}$$ if $$\displaystyle p=0.5$$ is not in this interval reject $$\displaystyle H_0$$ . This could be done by using the normal approximation to the binomial. But I think $$\displaystyle n$$ is too small in your case.

• craig

#### craig

I was going to suggest finding $$\displaystyle \text{C.I}_{0.95}$$ if $$\displaystyle p=0.5$$ is not in this interval reject $$\displaystyle H_0$$ . This could be done by using the normal approximation to the binomial. But I think $$\displaystyle n$$ is too small in your case.
Yeh I'd done that before with a different question, but as you said $$\displaystyle n$$ was too small this time.

Was what I did correct?

#### pickslides

MHF Helper
Yeh I'd done that before with a different question, but as you said $$\displaystyle n$$ was too small this time.
To have a normal approximation to the binomial then $$\displaystyle np>10$$ and $$\displaystyle (1-p)n>0$$

In your case $$\displaystyle np = 4$$

What what I did correct?
Not sure what you are saying here.

Interval I had in mind was,

$$\displaystyle \text{C.I}_{0.95} = p\pm Z_{\frac{\alpha}{2}}\times \sqrt{\frac{p(1-p)}{n}}$$

• craig

#### craig

Not sure what you are saying here.
Oops sorry typo, fixed that.

Interval I had in mind was,

$$\displaystyle \text{C.I}_{0.95} = p\pm Z_{\frac{\alpha}{2}}\times \sqrt{\frac{p(1-p)}{n}}$$
Ahh right thankyou!