in reply to Re^9: Algorithm RFC: fast (pseudo-)random shuffle with no repetition
in thread Algorithm RFC: fast (pseudo-)random shuffle with no repetition

The 15 came from the OP,

But as I said

> If this doesn't convince you that try-and-error isn't a good idea, try adding even more 1s and 2s.

for instance ((1)x 51, (2) x 50)

==>

((101!) / (51!)) / (50!) = 1.99804427433e+29

Cheers Rolf
(addicted to the Perl Programming Language :)
see Wikisyntax for the Monastery

Replies are listed 'Best First'.
Re^11: Algorithm RFC: fast (pseudo-)random shuffle with no repetition
by karlgoethebier (Abbot) on Sep 24, 2023 at 20:26 UTC

    There is nothing I have to be convinced of. It was clear that with this method at some point end is. With ((1)x 9, (2) x 8) the red area begins on the relatively weak machine on which I tried this via IPad/SSH: 0m0,003s in the best and 0m41,493s in the worst case so far. With ((1)x 51, (2) x 50) that's completely hopeless there. With the OP's example (15), the result was actually quite acceptable - unlike what he expected predicted by him.

    «The Crux of the Biscuit is the Apostrophe»