# Thread: Is the game fair?

1. ## Is the game fair?

Hi,

I have recorded the results of a binomial game (1 = win, 0 = lose.) The sequence is presented below. I am asked to provide compelling argument that this sequence represents statistically significant deviation from 0.5 probability (i.e. the game is not fair.) How should I go about approaching this task?

0,1,1,1,1,1,1,0,1,0,1,1,1,1,1,0,0,1,0,0,1,1,0,0,0,0,0,1,1,1,1,0,0,1,1,1,0,0,0,1,1

Thanks.

2. Originally Posted by ZPlayer
Hi,

I have recorded the results of a binomial game (1 = win, 0 = lose.) The sequence is presented below. I am asked to provide compelling argument that this sequence represents statistically significant deviation from 0.5 probability (i.e. the game is not fair.) How should I go about approaching this task?

0,1,1,1,1,1,1,0,1,0,1,1,1,1,1,0,0,1,0,0,1,1,0,0,0,0,0,1,1,1,1,0,0,1,1,1,0,0,0,1,1

Thanks.
you can construct a p-value for the two-tailed hypothesis test:

Ho: p = 0.5
Ha: p != 0.5

by using the binomial distribution with n = 40 trials and a hypothesized p = 0.5, with the observed number of wins constituting the test statistic. the p-value then would be twice the probability of observing at least a more extreme number of wins than 24. you can also use a normal test here with the same result.

it looks to me like there's insufficient evidence to say the game is not fair btw (at any common level of significance), unless you were to use the alternative hypothesis

Ha: p > .5

in which case you might (barely) reject Ho using a normal test.

3. ## Statistical confidence

Let's suppose that I keep playing this binomial game forever, and I record the game results in the sequence of 1s and 0s. I take a window of size n and slide it along this sequence. For every window, we take the number of 1s in the interval covered by the window and divide it by n. Let's suppose that most of the resulting frequencies are very close to 0.6 instead of 0.5.

Under what conditions is it possible to prove that 0.6 is a statistically significant result?

4. i think the normal test above covers that. the asymptotic distribution of the deviation of the observed number of 1's from n/2 in any window of size n is normal, so you can 'prove' the proportion of 1's observed is unlikely to whatever precision you'd like, so long as the size of the window is 'large enough'.

i think a common minimum rule for the normal z-test of proportions is that both np and n(1-p) must be greater than 5. so any window of size n such that those conditions are true would do the trick.

5. This interests me ...

Can I use the sign test?
so - n = 41
lowest = 17
so s = 17
using excel I get p = .017
It is bias to wins

?

6. the sign test was the original one i recommended, just not under the name sign test.

R gives me .3489 as the p-value for the two-tailed case and .1744 for a one-tailed test, neither which would be considered significant too frequently.

the normal case invokes the central limit theorem but is less powerful for small n. a two tailed normal test will yield a p-value of .2743, as compared to .1371 for the one-tailed case.

in both instances you probably wouldn't reject Ho, though it's certainly possible to at some higher probability of type I error.

7. yeah - I had 50 instead of 41 in my code (left over from my test data) - my numbers now match yours.

thanks!

8. ## Is the game fair?

Jahred, you seem to have understanding of the problem. I am quoting you below:
"...you can 'prove' the proportion of 1's observed is unlikely to whatever precision you'd like, so long as the size of the window is 'large enough'..."

I was under the impression that no matter how large is my sample, I will never be able to prove that if the probability (frequency) of win is 0.6 then it is significantly different than 0.5. It would be beneficial if you could provide me with some detailed calculations. Again, the point is: if I play the game and take any sample of size n, then the number of 1s over n is clustered around 0.6, not 0.5. So the point is to prove that the frequency of wins (i.e. probability of win) is 0.6, not 0.5. What is the minimal sample size to prove under significance level 0.01?

Thanks.

9. right - using the hypotheses

Ho: p = .5
Ha: p != .5

and a window large enough to employ a normal test, the test statistic is

Z* = (phat - p)/sqrt(p(1-p)/n)

where
phat = observed proportion (.6, for example)
p = expected proportion under Ho (.5, if the game is fair)

and Z* ~ N(0,1).

to reject Ho at 0.01 for this 2-tailed test, i need an observed tail probability of less than or equal to half that, or .005. the real numbers corresponding to those tail probabilities on N(0,1) are +- 2.5758.

so what i need is for the absolute value of Z* to be greater than 2.5758. for any observed proportion of wins .6, the test statistic is

Z*
= (.6 - .5)/sqrt(.5*.5/n)
= (.1/.5)sqrt(n)
= sqrt(n)/5

to make this greater than 2.5758, i just need to choose a sufficient n.

n = 25*(2.5758)^2
n = 166

so a window of size 166 will reject the hypothesis that the game is fair, and thus you'll conclude the true proportion of wins is significantly different from .5. your observed proportion of wins, .6, will be a statistically significant result.

10. and it's worth noting that if i make the assumption that the proportion must either be .5 or greater

Ho: p = .5
Ha: p > .5

then the size of the window required shrinks to 136.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts