2
$\begingroup$

Coin 1 $(c1)$: 550 Heads of 1000 flips.

Coin 2 $(c2)$ 60 heads of 100 flips.

Let's test the follow hypothesis for each:

$$H_0: p = 1/2 \quad H_A: p \neq 1/2$$ We know that: $$\mu = np \quad \sigma = \sqrt{np(1-p)}$$

Let's compute the following for each and see which coin has a larger magnitude: $$\frac{np - \mu_{H_A}}{\sqrt{np(1-p)}}$$ Coin 1:

$$\sigma_{c1} = \sqrt{500 \cdot 1/2} = \sqrt{10}\sqrt{50 \cdot 1/2} = 5\sqrt{10}$$ $$Z_{c1} = \frac{550-500}{5\sqrt{10}} = \frac{10}{\sqrt{10}} = \sqrt{10} \approx 3.16$$

Coin 2: $$\sigma_{c2} = \sqrt{50 \cdot 1/2} = \sqrt{50 \cdot 1/2} = 5$$ $$Z_{c2} = \frac{10}{5} = 2$$

Since $|Z_{c2}| < |Z_{c1}|$ we are more confident that $c1$ is biased.

Follow up questions:

  1. is the above approach valid?
  2. When would I use $\hat{p} = \frac{\# Heads}{\# Heads + \# Tails}$ instead of $p = .5$? This is when the null is that $p = \hat{p}$?
$\endgroup$
5
  • $\begingroup$ This post makes me think my approach is correct: math.stackexchange.com/a/1960282/117690 $\endgroup$ Commented Jun 25 at 12:58
  • 1
    $\begingroup$ Not following. the first coin is showing (more than) a $3\sigma$ event, whereas the second is only showing a $2\sigma$ event, so the bias of the first coin is more evident. $\endgroup$
    – lulu
    Commented Jun 25 at 13:06
  • 1
    $\begingroup$ It looks to me you have the inequality wrong compared to your calculation and $\Bbb Z_{c1}$ is the larger. $\endgroup$ Commented Jun 25 at 13:23
  • 2
    $\begingroup$ The approach is valid, but the reliance on $3.16$ being less than $2$ is a bit of a worry. $\endgroup$ Commented Jun 25 at 13:27
  • 1
    $\begingroup$ apologies typo -- I agree we are more sure that c1 is biased $\endgroup$ Commented Jun 25 at 13:37

2 Answers 2

1
$\begingroup$

The probability of seeing a result of $550/1000$ or another result as or more extreme under the unbiased hypothesis is about $0.0017$ using a binomial calculation, while the probability of seeing a result of $60/100$ or another result as or more extreme under the unbiased hypothesis is about $0.0569$.

Since $0.0017<0.0569$, this suggests you would be more confident that the first coin is biased.


The binomial calculation in R, since $550>1000\times \frac12$ and $60>100\times \frac12$:

> 2 * (1 - pbinom(550-1, 1000, 1/2))
[1] 0.001730536
> 2 * (1 - pbinom(60-1, 100, 1/2))
[1] 0.05688793

Using a normal approximation with a continuity correction gives similar results

> 2 * (1 - pnorm(550-1/2, 1000*1/2, sqrt(1000*1/2*1/2)))
[1] 0.00174417
> 2 * (1 - pnorm(60-1/2, 100*1/2, sqrt(100*1/2*1/2)))
[1] 0.05743312

You use $p=\frac12$ because that is the null hypothesis. Using $\hat p=0.550$ in the first case and $\hat p=0.60$ in the second would make sense if you are estimating the probabilities for each coin rather than testing a hypothesis.

$\endgroup$
1
$\begingroup$

If I were to interpret your question literally, I would compute, as a function of the confidence level $1-\alpha$, the $100(1-\alpha)\%$ confidence intervals for $p_1$ and $p_2$, and the interval that does not contain $1/2$ for the largest value of $1-\alpha$ corresponds to the coin that we are more confident is biased.

To this end, the Wald interval is given by $$\frac{x}{n} \pm z^*_{\alpha/2} \sqrt{\frac{x/n(1-x/n)}{n}},$$ where $x$ is the number of heads observed, $n$ is the sample size, and $z^*_{\alpha/2}$ is the upper $\alpha/2$ quantile of the standard normal distribution. Consequently, for the first coin, the interval is $$0.55 \pm 0.0157321 z^*_{\alpha/2},$$ and for the second, it is $$0.6 \pm 0.0489898 z^*_{\alpha/2}.$$ Since the point estimate for each is above $0.5$, we set the lower boundary of each interval to be $0.5$ and solve for $\alpha$. Thus for the first coin, $$1 - \alpha = 2\Phi\left(\frac{10}{3}\sqrt{\frac{10}{11}}\right) - 1 \approx 2\Phi(3.17821) - 1 \approx 0.998518,$$ and for the second, $$1 - \alpha = 2\Phi\left(\frac{5}{\sqrt{6}}\right) - 1 \approx 0.958773.$$ Therefore, we can be at most $99.85\%$ confident that the first coin is biased, but we can be only at most $95.88\%$ confident that the second coin is biased.

Alternative confidence levels can be computed using different interval estimates; e.g., the Wilson score interval, or the exact binomial interval, but for a sample size this large, the differences are small.

$\endgroup$
3
  • $\begingroup$ Is there a reason you write that we are "at most" however confident? It sounds as though we might, in reality, not be as "confident" as we think we are and therefore... I mean, it would seem then that all bets are off :). Also, I understand that a Wald interval is bounded, but since we're interested in $p$ being greater than $1/2$, can we simply say, e.g., that our confidence level for the first coin's bias is $1 - \Phi(-3.17) \approx .9992$ ? $\endgroup$
    – dmk
    Commented Jun 28 at 17:18
  • $\begingroup$ @dmk A confidence interval is associated with a confidence level. Generally speaking, the higher this level, the wider the interval must be. Any confidence level below the maximum we computed will also have an interval that does not contain $1/2$. If tell you $x \le 4$, that doesn't mean $x = 4$ is disallowed. It also doesn't mean $x = 4$ is the only solution. The confidence level is something you choose in accordance with your desired coverage probability. The fact that you cannot choose a higher confidence level for the second coin than the first, is the literal answer to your question. $\endgroup$
    – heropup
    Commented Jun 28 at 17:27
  • $\begingroup$ To state it more clearly; you can certainly choose a confidence level for both interval estimates in such a way that both confidence intervals will not contain $1/2$; e.g., choose $1 - \alpha = 0.95$. But there exists a choice for which coin 1 will lead you to reject the hypothesis that the coin is fair (i.e., you would conclude it is biased), whereas that same choice would not allow you to reject the same hypothesis for coin 2. $\endgroup$
    – heropup
    Commented Jun 28 at 17:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .