Repository navigation
Milestone
Description
See - https://ghc.haskell.org/trac/ghc/ticket/3620 (and also https://ghc.haskell.org/trac/ghc/ticket/3575) I just ran the example https://ghc.haskell.org/trac/ghc/attachment/ticket/3620/RandomnessTest2.hs and got
Generated 2000 pairs of numbers from 0 to 1 -- 1299 pairs contained equal numbers and we expected about 1000.
Generated 3000 pairs of numbers from 0 to 2 -- 187 pairs contained equal numbers and we expected about 1000.
Generated 4000 pairs of numbers from 0 to 3 -- 101 pairs contained equal numbers and we expected about 1000.
Generated 5000 pairs of numbers from 0 to 4 -- 271 pairs contained equal numbers and we expected about 1000.
Generated 6000 pairs of numbers from 0 to 5 -- 359 pairs contained equal numbers and we expected about 1000.
Generated 7000 pairs of numbers from 0 to 6 -- 1401 pairs contained equal numbers and we expected about 1000.
Generated 8000 pairs of numbers from 0 to 7 -- 158 pairs contained equal numbers and we expected about 1000.
Generated 9000 pairs of numbers from 0 to 8 -- 53 pairs contained equal numbers and we expected about 1000.
Generated 10000 pairs of numbers from 0 to 9 -- 535 pairs contained equal numbers and we expected about 1000.
Generated 11000 pairs of numbers from 0 to 10 -- 0 pairs contained equal numbers and we expected about 1000.
Generated 12000 pairs of numbers from 0 to 11 -- 70 pairs contained equal numbers and we expected about 1000.
Generated 13000 pairs of numbers from 0 to 12 -- 0 pairs contained equal numbers and we expected about 1000.
Generated 14000 pairs of numbers from 0 to 13 -- 0 pairs contained equal numbers and we expected about 1000.
Generated 15000 pairs of numbers from 0 to 14 -- 783 pairs contained equal numbers and we expected about 1000.
On the other hand the example from http://publications.lib.chalmers.se/records/fulltext/183348/local_183348.pdf now seems to work
> quickCheckWith stdArgs { maxSuccess = 10000 } prop_shouldFail
*** Failed! Falsifiable (after 2 tests):
((),Int14 13)
Int14 13
Metadata
Metadata
Assignees
Labels
No labels
Activity
idontgetoutmuch commentedon Mar 29, 2015
I just tried the same test but using https://hackage.haskell.org/package/tf-random
and this gives what seems to be a correct result
idontgetoutmuch commentedon Mar 29, 2015
Here's the example from http://kenta.blogspot.co.nz/2014/02/rzzllapd-nonrandomness-of-first-random.html (slightly modified to use the histogram-fill package)
Not really very random, Dilbert notwithstanding: http://dilbert.com/strip/2001-10-25.
cartazio commentedon Mar 29, 2015
Sounds like weve got some work to do
On Mar 29, 2015 10:53 AM, "idontgetoutmuch" [email protected]
wrote:
cartazio commentedon Mar 29, 2015
I kinda suspected the current splitting design had this sort of problem but
it's good we now have evidence!
On Mar 29, 2015 11:49 AM, "Carter Schonwald" [email protected]
wrote:
Add some tests demonstrating #25.
gbaz commentedon Apr 4, 2015
This splitting design has been known to have this problem for the past six years going by those tickets -- I think longer. And the guarantees made by the random library have never suggested otherwise. So I think a better random should have better splitting but I also think that this is not an immediate "must fix" bug, but a property that should inform our selection of a new random algorithm in the coming future.
cartazio commentedon Apr 4, 2015
agreed, and i think its worth burning some time on
building some infrastructure to compare different algorithms in both
quality of randomness AND in performance
exploring preexisting algorithms, and experimenting with new approaches
informed by preexisting work AND buttressed by having a really good quality
RNG testing infrastructure that we can be systematic about
On Sat, Apr 4, 2015 at 2:54 PM, gbaz [email protected] wrote:
idontgetoutmuch commentedon Apr 9, 2015
@gbaz by "guarantees made by the random library have never suggested otherwise" do you mean the haddock comment
or the comment in the actual implementation
or is there something I am missing?
gbaz commentedon Apr 10, 2015
This makes clear to me that there was never a promise of statistical independence between split generators -- just that independently each generator is robust.
So this is well documented behaviour. (Which doesn' t mean it is good behaviour, and doesn't mean we shouldn't replace it with better behaviour now that we have new research and implementations).
cartazio commentedon Apr 10, 2015
agreed. And some effort and time this summer should be spent exploring the
choices
On Thu, Apr 9, 2015 at 9:28 PM, gbaz [email protected] wrote:
idontgetoutmuch commentedon Apr 16, 2015
The second example I gave, rolling a die and getting 53668 sixes and no other numbers, does not use
splitjustrandomR.idontgetoutmuch commentedon Apr 16, 2015
Some old related discussion: https://mail.haskell.org/pipermail/haskell-cafe/2010-November/thread.html#85959
gbaz commentedon Apr 16, 2015
The second example doesn't just use
randomR-- it callsmkStdGenfor each roll individually, which creates a new generator. As far as I know,mkStdGenin turn calls split.Regardless, it is never considered the case that making new generators without introducing explicit randomness should somehow guarantee that the sequence of generators you make are mutually uncorrelated.
If you change the example to share the same generator, the problem does not exist. We could perhaps improve the documentation to more clearly warn against this bad usage pattern.
dolio commentedon Apr 16, 2015
I don't think it even does that. It just creates a new generator from a specific seed. The complaint is that seeding with N doesn't differ from seeding with (N+1) when generating a single number from 1 to 6.
idontgetoutmuch commentedon Sep 17, 2015
I believe some comparison work has been done. I am recording these links below for information.
https://github.com/nkartashov/SplitMix
https://github.com/nkartashov/prng-test
https://github.com/nkartashov/prng-bench
https://github.com/nkartashov/htestu
17 remaining items
Merge pull request #25 from idontgetoutmuch/export-uniform
parent cfdfe6f
parent cfdfe6f
Fix quality and performance issues, add monadic API
Fix quality and performance issues, add monadic API
Fix quality and performance issues, add monadic API
Fix quality and performance issues, add monadic API
Fix quality and performance issues, add monadic API
Fix quality and performance issues, add monadic API
Fix quality and performance issues, add monadic API
Fix quality and performance issues, add monadic API
Fix quality and performance issues, add monadic API
Fix quality and performance issues, add monadic API