> I count 7! = 5,040 solutions.
Of course you are right, what my my brain saw was that there is only one possible way to position the 1s.°
What I should better have shown is
(1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2)
which has only one solution
(1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1)
and 15! divided by 7! is still a very big number.
> I don't see mention in Algorithm::Permute of how it handles duplicate elements,
Assuming worst case means it's not handling duplicates differently. Many hear just use shuffle which certainly doesn't care.
Cheers Rolf
(addicted to the Perl Programming Language :)
see Wikisyntax for the Monastery
°) off by one permutation group ;)
In reply to Re^8: Algorithm RFC: fast (pseudo-)random shuffle with no repetition
by LanX
in thread Algorithm RFC: fast (pseudo-)random shuffle with no repetition
by Anonymous Monk
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |