8
$\begingroup$

I made a 3D printed die today, but depending on the heat applied, it may or may not be a "fair" die (i.e. have an equal chance of landing on each face).

I have just tried rolling it 150 times. The frequency results came out to:

$$ \begin{array}{c|c} \hline 1's & 21 \\ \hline 2's & 30 \\ \hline 3's & 23 \\ \hline 4's & 31 \\ \hline 5's & 21 \\ \hline 6's & 24 \\ \hline \end{array} $$

How would I calculate the chance that this die is fair?

$\endgroup$
  • $\begingroup$ I'm not familiar with the term "Laplacian die." Do you perhaps mean a "fair die" (one in which each side is equally likely to appear when tossed)? Otherwise, could you please define your terms? $\endgroup$ – JMoravitz Dec 16 '15 at 21:08
  • $\begingroup$ What is a Laplacian die? Is it a fair die? If so, you can't, if you're a Bayesian; you need a prior. Otherwise, you try to refute the null hypothesis that the die is fair, and evaluate the probability of obtaining the results you did with something like the chi-squared test. $\endgroup$ – Brian Tung Dec 16 '15 at 21:09
  • 3
    $\begingroup$ The $\chi^2$-value here is $3.92$, which is absolutely non-significiant. There is no reason to doubt the fairness of the die. $\endgroup$ – Peter Dec 16 '15 at 21:41
  • 1
    $\begingroup$ @Peter But there is little reason to believe in fairness of the die either... (given that it's the first ever dice produced by this printer and fairness of a die is very sensitive to small variations in shape). $\endgroup$ – A.S. Dec 18 '15 at 6:39
  • 1
    $\begingroup$ @cel I don't see how you can consider "probability of getting a 6" as an inherent property of a die since the outcome of the throw depends not only on the die itself but on mechanics of the throw - which automatically leads to a limit in how well you can differentiate different dice. Basically, no number of throws will ever distinguish $1/6$ from $1/6+10^{-100}$ due to fluctuations in the throw itself and unclear relationship between die bias, throw distribution and outcome. $\endgroup$ – A.S. Dec 18 '15 at 7:39
9
$\begingroup$

Goodness-of-fit test. Computation in R. Results agree with Comment by @Peter.

 obs = c(21, 30, 23, 31, 21, 24)
 chisq.test(obs)

    Chi-squared test for given probabilities

 data:  obs 
 X-squared = 3.92, df = 5, p-value = 0.561

If observed counts are $X_i$ and expected counts are $E = 150/6 = 25,$ Then the chi-squared goodness-of-fit statistic is $Q = \sum_{i=1}^6 (X_i - E)^2/E,$ which is approximately distributed as $Chisq(DF = 5).$ The critical value for a test at level 5% is 11.07. We fail to reject the null hypothesis that all six faces are equally likely because $Q = 3.92 < 11.07.$

Power. However, I'm wondering if 150 rolls is enough. Suppose your die is markedly biased so that faces 1, 2, and 3 each have probability 5/36 and faces 4, 5, and 6 each have probability 7/36. Then the following simulation shows that only about 27 in 100 tests with 150 rolls would reject the hypothesis of fairness. That is, the power of the goodness-of-fit test against this particular degree of bias is about 27%. More modestly biased dice would fail the test at an even lower rate.

 m = 10^5;  q = numeric(m); E = 150/6
 for(i in 1:m) {
   faces = sample(1:6, 150, repl=T, prob=c(5,5,5,7,7,7)/36)
   x = table(faces);  q[i]=sum((x-E)^2/E)}
 mean(q > qchisq(.96, 5))
 ## 0.2702

The histogram shows values of $Q$ for 100,000 tests, each using 150 rolls of such a biased die. The vertical line is the critical value for a test at level 5%. The curve is the density of $Chisq(5)$.

enter image description here

Prompted by a comment, I ran a slight modification of the R code that shows 89% power for the same biased die as above, but using 600 rolls for the test. The corresponding graph is shown below.enter image description here

Note: I have posted a Bayesian analysis of the data for face 1 separately.

$\endgroup$
  • 1
    $\begingroup$ How many rolls would i roughly need to to have a 90% chance that the test is right an a die that is biased only 5% so 5.6 or 6.4. Also what would happen if there are only 2 sides that are different e.g. 1 and 6 with 5/36 and 7/36 respectively and the rest is 1/6? $\endgroup$ – Eumel Dec 18 '15 at 8:48
  • $\begingroup$ It would require several more simulations to answer such questions. The R code is easy to modify, but each run takes a couple of minutes on my ancient computer. For a 150 rolls, the power against the alternative distribution (1/9, 1/9, 1/9, 2/9, 2/9, 2/9) is about 90%. But that is an extremely biased die. You are right to suppose that power depends on degree of biasedness and number of rolls. $\endgroup$ – BruceET Dec 18 '15 at 17:03
  • 1
    $\begingroup$ @Eumel As a ball-park, consider that to distinguish $B(n,p)$ and $B(n,p+\epsilon)$ you need $n\gg p(1-p)\epsilon^{-2}$, so you need at least $750$ tests. $\endgroup$ – A.S. Dec 18 '15 at 17:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.