# Is the coin fair?

A coin was tossed n 1000 times, and the proportion of heads observed was 0.51. Do we have evidence to conclude that the coin is unfair?

My approach:

expected value for the number of heads is 1000*0.15=510

in theory, the probability will be 0.5 and that means 500 out of 1000 coins would show head

so this is fair

– Mark
Feb 28, 2017 at 3:51
• Yes, so should I do a hypothesis test that null hypothesis is p(head)=0.5 and another hypothesis that P(head) is not 0.5?
– max
Feb 28, 2017 at 3:53
• Yes. Choose a p-value beforehand such that you would be willing to reject the null hypothesis. Answer this question: What is the probability that a fair coin would be more than 0.01 away from fair when tossed 1000 times? You might have also learned that you can use a normal distribution as an approximation when the number of tosses is this high.
– Mark
Feb 28, 2017 at 3:56
• I think you meant to to look at '1000(.51) = 510'. Feb 28, 2017 at 20:26

With a sample as large as $n = 1000$ and $p$ in the vicinity of 1/2, a normal approximation should work well.

To test the null hypothesis $H_0: p = .5$ against the alternative $H_a: p > .5$ you need to compute the test statistic $$Z = \frac{\hat p - p_0}{\sqrt{p_0(1-p_0)/n}}.$$

In your example, you have $\hat p = 0.51,\,p_0 = 0.5,$ and $n = 1000.$ You would reject the null hypothesis $H_0,$ saying that the data from the $n = 1000$ flips of the coin are inconsistent with the behavior of a fair coin, at the 5% level if $Z > 1.645.$ (The 'critical value' cutting 5% of the probability from the upper tail of a standard normal distribution, can be found from printed normal CDF tables or from software.)

1 - pbinom(509, 1000, .5)
## 0.02522502               $P(EXACTLY 500 heads)  • I got the z value as 0.6329 and the p-value =0.528 and therefore we cannot reject the null hypothesis. Does it mean that the coin is not fair? I have the same p-value in the back of book – max Mar 1, 2017 at 3:15 • You can look at it two ways: (a) It means the data we have is consistent with a fair coin. (b) It means you don't have solid evidence the coin is biased. We will never know 'for sure' whether the coin is biased. We can only see our data, and make statements about our data. And we don't have much of it. To try to make reasonable judgments about the difference between$p = .50$and$p=.51,$it would take about$n=10,000$tosses of the coin. Mar 1, 2017 at 4:43 • BTW: From what you say about the answer in the book, it seems they are testing$H_0: p = .5$against the two-tailed alternative$H_a: p \ne .5.$That is a reasonable choice. In my answer, notice that I assumed a right tailed alternative. Mar 1, 2017 at 5:25 • yeah, i forgot to mention that the other hypothesis is p!=0.5 – max Mar 1, 2017 at 5:36 • Main difference then: Reject for$|Z| > 1.96$, not$Z > 1.645.\$ So still can't reject. Mar 1, 2017 at 17:36