# [SOLVED]Hypothesis testing - Winning a game

#### mathmari

##### Well-known member
MHB Site Helper
Hey!! A and B play 100 games of squash; A wins E times. B claims that both of them have the same probability of winning a game.
We consider that the games are independent.

(a) Formulate the null hypothesis and the alternative hypothesis.
(b) For which values of $E$ will the null hypothesis be rejected with $\alpha=1\%$ and for which with $\alpha=5\%$ ?

Is at (a) the null hypothesis $H_0: \ p=\frac{1}{2}$ and the alterinative hypothesis $H_1: \ p\neq \frac{1}{2}$ ? Or do we call $p_A$ the probability of $A$ and $p_B$ the probability of $B$, and so the null hypothesis is $H_0: \ p_A=p_B$ and the alterinative hypothesis $H_1: \ p\_A\neq p_B$ ? #### Jameson

Staff member
Hey mathmari,

I would use the second way to frame this.

This link should be useful for comparing two samples of proportions.

#### mathmari

##### Well-known member
MHB Site Helper
I would use the second way to frame this.

This link should be useful for comparing two samples of proportions.
So, we have the following:
$$H_0: \ p_A-p_B=0 \ \ \text{ and } \ \ H_1: \ p_A-p_B\neq 0$$

The test statistic is given by the formula $$Z=\frac{\hat{p}_A-\hat{p}_B}{\sqrt{\hat{p}(1-\hat{p})\left (\frac{1}{n_A}+\frac{1}{n_B}\right )}}$$

Is the size of the first population equal to the size of the second one, equal to $100$, i.e. $n_A=n_B=100$ ?

If yes, then we have that $\hat{p}_A=\frac{E}{100}$ and $\hat{p}_B=\frac{100-E}{100}$, or not?

Does it then hold that $\hat{p}=\hat{p}_A+\hat{p}_B=\frac{E}{100}+\frac{100-E}{100}=1$ ? #### Klaas van Aarsen

##### MHB Seeker
Staff member
So, we have the following:
$$H_0: \ p_A-p_B=0 \ \ \text{ and } \ \ H_1: \ p_A-p_B\neq 0$$

The test statistic is given by the formula $$Z=\frac{\hat{p}_A-\hat{p}_B}{\sqrt{\hat{p}(1-\hat{p})\left (\frac{1}{n_A}+\frac{1}{n_B}\right )}}$$

Is the size of the first population equal to the size of the second one, equal to $100$, i.e. $n_A=n_B=100$ ?

If yes, then we have that $\hat{p}_A=\frac{E}{100}$ and $\hat{p}_B=\frac{100-E}{100}$, or not?

Does it then hold that $\hat{p}=\hat{p}_A+\hat{p}_B=\frac{E}{100}+\frac{100-E}{100}=1$ ?
Hey mathmari !!

We only have 1 sample with $n=100$, so we can't do a 2-sample test of independent samples can we? #### mathmari

##### Well-known member
MHB Site Helper
We only have 1 sample with $n=100$, so we can't do a 2-sample test of independent samples can we? Oh yes. So we cannot apply the formula of the above link, can we? #### Klaas van Aarsen

##### MHB Seeker
Staff member
Oh yes. So we cannot apply the formula of the above link, can we?
Indeed. We need a different formula for a 1-sample proportion test.
It also means that we should have a hypothesis about a single proportion. #### mathmari

##### Well-known member
MHB Site Helper
Indeed. We need a different formula for a 1-sample proportion test.
It also means that we should have a hypothesis about a single proportion. So do we have the null hypothesis $H_0: p=\frac{1}{2}$ and the alternative hypothesis is $p\neq \frac{1}{2}$, or how do we formulate these hypotheses?

If we have these hypotheses, we get the following:

The test statistic is $$Z=\frac{\hat{p}-p_0}{\sqrt{\frac{p_0(1-p_0)}{n}}}=\frac{\frac{E}{100}-\frac{1}{2}}{\sqrt{\frac{\frac{1}{2}\left (1-\frac{1}{2}\right )}{n}}}=\frac{\frac{E}{100}-\frac{1}{2}}{\sqrt{\frac{1}{4n}}}=\frac{\frac{E-50}{100}}{\frac{1}{2\sqrt{n}}}=\frac{(E-50)\sqrt{n}}{50}$$

Now we have to compare this with $z_{1-\alpha/2}$, or not? #### Klaas van Aarsen

##### MHB Seeker
Staff member
All correct.
And we can already fill in n=100. Can't we? #### mathmari

##### Well-known member
MHB Site Helper
All correct.
And we can already fill in n=100. Can't we? Oh yes, you're right!! Thank you so much!! #### Jameson

Oh yes. So we cannot apply the formula of the above link, can we? No problem! Thank you!! 