Permutations/Rank of a permutation: Difference between revisions

m
Fix Perl 6 -> Raku in comments
(Rename Perl 6 -> Raku, alphabetize, minor clean-up)
m (Fix Perl 6 -> Raku in comments)
Line 1,433:
=={{header|Raku}}==
(formerly Perl 6)
 
It is similar to Haskell, but separate something like [https://en.wikipedia.org/wiki/Inversion_(discrete_mathematics) inversion vector].
It is easy generate random inversion vector without BigInt.
Line 1,481 ⟶ 1,482:
};
 
say 'Via Perl 6Raku method pick';
for ( { [(^$n).pick(*)] } ... * ).unique( with => &[eqv] ).head($perms) {
.say
Line 1,504 ⟶ 1,505:
[9 8 5 11 1 10 0 7 4 6 2 3]
[10 8 6 5 4 9 0 2 11 7 1 3]
Via Perl 6Raku method pick
[11 0 7 10 9 4 1 8 6 5 2 3]
[4 5 8 3 2 1 7 9 11 0 10 6]
10,327

edits