Anonymous user
Permutations/Rank of a permutation: Difference between revisions
Permutations/Rank of a permutation (view source)
Revision as of 09:43, 26 October 2012
, 11 years agoSp.
(Another good reference) |
m (Sp.) |
||
Line 44:
;References:
# [http://webhome.cs.uvic.ca/~ruskey/Publications/RankPerm/RankPerm.html Ranking and Unranking Permutations in Linear Time] by
# [http://www.davdata.nl/math/ranks.html Ranks] on the DevData site.
# [http://stackoverflow.com/a/1506337/10562 Another answer] on Stack Overflow to a different question that explains its algorithm in detail.
=={{header|Python}}==
This is based on the work shown in the paper by
Their algorithm is efficient and pythons transparent use of arbitrary precision integers allows the Stack Overflow questions limits to be used. (Chopped at four rather than a million random samples although function get_random_ranks(144, 1e6) doesn't take long).
|