Wikipedia:Reference desk/Archives/Mathematics/2017 November 29

= November 29 =

Simple dice probability question
On an online forum about debugging a new computer game, someone opined that the dice were biased.

Another user reported:

"I logged 500 rolls:

1 - 17.80%

2 - 18.60%

3 - 16.20%

4 - 13.40%

5 - 17.00%

6 - 17.00%"

How likely is it that the above result shows a bias? More importantly, what is the best way to calculate this? --Guy Macon (talk) 01:39, 29 November 2017 (UTC)


 * The natural way to measure the deviation is to subtract each of those percentages from 1/6, square the results, and add them. In this case, you get 0.0016....  I think that some form of the chi-squared test is the right tool.  It is also possible to do this with simulated data: when I simulate the dice rolls 1000 times, I get numbers ranging from 0.0001013... to 0.008205... with median 0.001453... and 60th percentile value 0.0017253....  This fails to reject the null hypothesis of "fair dice" at any reasonable standard.   --JBL (talk) 02:02, 29 November 2017 (UTC)


 * Going by the approximation sigma^2=npq, #4 is just about 1 standard deviation under the mean. In practice, this amount of deviation proves nothing at all. 93.136.72.241 (talk) 02:32, 29 November 2017 (UTC)
 * Right, but that's not really the question. That would be the test if you were wanting to know whether the die was specifically biased against the number 4.  JBL has it right &mdash; use a Χ2 test.
 * As it happens, Pearson's chi-squared test gives almost exactly this example. --Trovatore (talk) 08:58, 29 November 2017 (UTC)

The reported results are x1=89, x2=93, x3=81, x4=67, x5=85, x6=85, and $$\sum_{i=1}^6 x_i = 500$$. The probabilities are $$p_i$$ where $$\sum_{i=1}^6 p_i = 1$$. They have the dirichlet distribution. They are estimated by $$p_i\approx \mu_i \pm \sqrt{\mu_i \epsilon_i}$$ where the mean value is $$\mu_i = {x_i +1\over \sum_{i=1}^6 (x_i+1)}$$ and the eccentricity is $$\epsilon_i = {1-\mu_i\over 1+\sum_{i=1}^6 (x_i+1)}$$. Note that $$\sum_{i=1}^6 \mu_i = 1$$ so the degree of freedom is k = 6-1 = 5. The Pearson test statistics is $$\chi^2=\sum_{i=1}^6 {{(\mu_i - {1 \over 6})^2}\over \mu_i\epsilon_i}$$. This Chi-squared distribution has $$\chi^2\approx k\pm \sqrt{2 k}$$, so $${\chi^2-k \over\sqrt{2 k}}\approx \pm 1$$. The J expression below shows that $${\chi^2-k \over\sqrt{2 k}}=0.43$$. The observations do not indicate that the die is biased. (%:10)%~5-~+/(*:mu-%6)%mu*507%~1-mu=.506%~1+89 93 81 67 85 85 0.429046 Bo Jacoby (talk) 23:51, 29 November 2017 (UTC).

Logic: I'm looking for three formulas of propositional calculus
each of which can be inferred from the other two, yet not from either - of the other two - apart. HOTmag (talk) 08:53, 29 November 2017 (UTC)
 * Unless I make a mental mistake, consider a&b, a&c, b&c. --Stephan Schulz (talk) 08:58, 29 November 2017 (UTC)
 * I don't think that works. Suppose a&and;b and b&and;c are both false.  Is a&and;c true or false?  Could be true, if b is false and a and c are true, but could be false, if a, b, and c are all false. --Trovatore (talk) 09:05, 29 November 2017 (UTC)
 * You made a good start, though. Instead of "and", use "exclusive or" &mdash; a⊕b, a⊕c, b⊕c.  Then (for example) a⊕c = (a⊕b)⊕(b⊕c) (because ⊕ is associative, and b⊕b cancels out). --Trovatore (talk) 09:11, 29 November 2017 (UTC)
 * Did you respond to me or to Stephan? HOTmag (talk) 09:08, 29 November 2017 (UTC)
 * To Stephan &mdash; that's why I fixed the indent. --Trovatore (talk) 09:12, 29 November 2017 (UTC)
 * Typically, for inferences you only require that every model of the premisses is a model of the conclusion. I.e. $$a \wedge b, b\wedge c \models a\wedge c$$ if whenever both $$a \wedge b$$ and $$b\wedge c$$ evaluate to true under an interpretation, then $$a\wedge c$$ must also be true under it. I think that is the case. What happens when one of the premisses is false is irrelevant. But I didn't have my coffee yet...--Stephan Schulz (talk) 09:14, 29 November 2017 (UTC)
 * Oh, I took it to mean that the truth value of each of the three formulas could be inferred from the truth value of the other two. But your interpretation makes sense, and is probably a more literal reading of the question.  --Trovatore (talk) 09:23, 29 November 2017 (UTC)
 * Correct. Anyway, Stephan's interpretation was what I really meant. Thanks to both of you. HOTmag (talk) 09:39, 29 November 2017 (UTC)

HOTmag (talk) 09:39, 29 November 2017 (UTC)