[CoLoCo] dice rolls in C

Richard Guenther richskyline at gmail.com
Wed Feb 13 02:15:55 GMT 2008


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...."

Now there's an idea: how about making your own RNG?  Hmmm... may have to
give that one to some of my students. :-)

--Richard

On Feb 11, 2008 9:11 PM, Jim Hutchinson <jim at ubuntu-rocks.org> wrote:

>
>
> In doing some reading I saw some examples that used chi-squared to
> test deviation from the expected values. They were done by hand. I
> wonder how you do it with a million results... I think I'll play
> around with Open Office and see what it can do.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.ubuntu.com/archives/ubuntu-us-co/attachments/20080212/c1680846/attachment.htm 


More information about the Ubuntu-us-co mailing list