simon-svn: puzzles: simon

tartarus-commits at lists.tartarus.org tartarus-commits at lists.tartarus.org
Wed May 4 13:52:52 BST 2005


SVN root:       svn://ixion.tartarus.org/main
Changes by:     simon
Revision:       5742
Date:           2005-05-04 13:52:51 +0100 (Wed, 04 May 2005)

Log message (9 lines):
The Twiddle shuffling algorithm was theoretically parity-unbalanced:
it performed a fixed number of shuffling moves, and on each one it
had a 2/3 chance of flipping the permutation parity and a 1/3 chance
of keeping it the same. Markov analysis shows that over a run of
1500-odd shuffle moves this will end up being an undetectably small
actual bias in the parity of the generated grid, but it offends my
sense of pedantry nonetheless so here's a small change to make the
number of shuffling moves itself have randomly chosen parity. The
parity of generated grids should now be _exactly_ 50:50.

Modified files:
U   puzzles/twiddle.c

Links:
http://www.tartarus.org/~simon-anonsvn/viewcvs.cgi?rev=5742&view=rev
http://www.tartarus.org/~simon-anonsvn/viewcvs.cgi/puzzles/twiddle.c?rev=5742&r1=5741&r2=5742



More information about the tartarus-commits mailing list