Test to determine whether coin is fair or not A coin is tossed 10 times. How can we determine whether it is fair or not?
My approach:
This seems to be like a Binomial experiment.
I know that for a fair coin, the fraction of heads should be 0.5.

*

*Null Hypothesis: fraction of Head is 0.5

*Alternative Hypothesis: fraction of Head is not 0.5

But how do you calculate any statistic ?
The mean, I guess, is $n \times p$. The std. dev. is $\sqrt{(np(1-p))}$.
If some knows the answer please tell me. Also please let me know if my approach is right or wrong.
 A: Another way to extract probabilities is to simulate :
Imagine a fair coin.
Toss it 10 times and write down the number of heads.
According to the central limit theorem, the number of heads in 10 tosses will follow a Normal-like distribution with mean
Then do it all over again. And again. And again. N times (maybe N = 1000000 times)
Then calculate the 2.5th and 97.5th percentiles of the distribution of the N simulated number of heads.
Now you toss your real coin ten times and write the number of heads.
If you got less heads than the 2.5th percentile, or more heads than the 97.5th, then you decide that the coin is not fair.
Don't forget that this time when you tossed your real coin 10 times and rejected the hypothesis of the fair coin, could be among the 5% of identical experiments where the result would have been extreme enough to get rejected despite the coin being fair.
A: The formula to calculate the approximate confidence limits for a binomial test is:
$z_{alpha/2}*\sqrt{p*q/n}$
In your case for a fair coin p = q = 0.5 and using $z_{alpha/2}=1.96$ for a 95% confidence limit.
The range of heads for 10 flips is expected to be between
$ 10*(0.5 \pm 1.96*\sqrt{0.025})$ or 1.9 to 8.1 heads
with a 95% confidence level.
Or to rearrange to calculate the test statistic:
$test statistic = \frac{(observed - n*p_{expected})}{\sqrt{n*p*q}}$
In R use binom.test(5, 10, p=0.5)
A: The Red Bead experiment and Deming is where I start.
An unfair coin is a special or assignable cause of variation. When should we look for a special cause? When we see something beyond 3 standard deviations.
10 flips might not be enough.
.5 +/- 3 times sqrt of (.5*.5/N), where N is number of flips.
More than ~ 9.743 H or Ts might be worth looking at. But can you have .7 of a head? No. So you should round 9.7 to 10, in which case probably not meaningful to investigate if 10 flips in a row is all you have.
But a better approach might be to assume the coin is unfair and follow Von Neumann who described a procedure like this:

*

*Toss the coin twice.

*If the outcome of both coins is the same (HH or TT), start over and disregard the current toss.

*If the outcome of both coins is different (HT or TH), take the first coin as the result and forget the second.

