Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 2686 by [email protected]: unrank_lex gives wrong results
http://code.google.com/p/sympy/issues/detail?id=2686

unrank_lex gives the correct permutations when their
array form starts with 0,
but the remaining permutations are wrong

from sympy.combinatorics.permutations import Permutation
for i in range(6):
...   print Permutation.unrank_lex(3, i)
...
Permutation([0, 1, 2])
Permutation([0, 2, 1])
Permutation([0, 1, 2])
Permutation([0, 2, 1])
Permutation([0, 1, 2])
Permutation([0, 2, 1])

I fixed the problem in https://github.com/pernici/sympy/tree/perm1
Using this version

from sympy.combinatorics.permutations import Permutation
for i in range(6):
...   print Permutation.unrank_lex(3, i)
...
Permutation([0, 1, 2])
Permutation([0, 2, 1])
Permutation([1, 0, 2])
Permutation([1, 2, 0])
Permutation([2, 0, 1])
Permutation([2, 1, 0])


--
You received this message because you are subscribed to the Google Groups 
"sympy-issues" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sympy-issues?hl=en.

Reply via email to