[CoLoCo] dice rolls in C

Jim Hutchinson jim at ubuntu-rocks.org
Wed Feb 13 03:04:57 GMT 2008


On Feb 12, 2008 7:15 PM, Richard Guenther <richskyline at gmail.com> wrote:
> Chi-square tests are pretty easy.  Suppose you were rolling a 6 sided die
> six million times.  You'd expect about one million for each of the six
> faces.  So the Expected would be 1 mil for each of those.  Then you take
> what you got, find the difference and square it, and so on.  The idea is
> that with a preset confidence level (like p = .05) there will be some number
> of results that is NOT what we would expect.
>
> 1,002,356 results for the "6" face may not be significant, but
>
> 1,683,456 results for the "6" face would be.
>
> Using OpenOffice Spreadsheet for a chi square analysis should be a breeze.
> If you need help with the fields, let me know.
>
> Remember, though, that a really crappy RNG could still pass the Chi-Square
> with flying colors and still be the crappiest RNG around: "Here are the
> results: 1,2,3,4,5,6,1,2,3,4,5,6,1,2,3,4...."

You may be right about this. I generated some random dice rolls and
tried several tests with them always coming out to 0. With very large
samples this seems particularly problematic. I decided to do the test
more manually and fudged the numbers a bit to make a "loaded" die. The
results are attached. Even though my die clearly favors sums involving
a 1 on one die, my test stat of 13.7 is still below 18.31 (value for
10 df and alpha of .05) so I would not reject my null hypothesis that
the dice are fair (even though they are not). Assuming I'm doing this
right (and I may not be) this test seems rather useless.

-jim

-- 
Please avoid sending me Word or PowerPoint attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: chi_data.ods
Type: application/vnd.oasis.opendocument.spreadsheet
Size: 11328 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/ubuntu-us-co/attachments/20080212/1e92aab9/attachment-0001.ods 


More information about the Ubuntu-us-co mailing list