Jump to content

Wikipedia:Reference desk/Archives/Mathematics/2013 June 16

From Wikipedia, the free encyclopedia
Mathematics desk
< June 15 << May | June | Jul >> June 17 >
Welcome to the Wikipedia Mathematics Reference Desk Archives
The page you are currently viewing is a transcluded archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages.


June 16

[edit]

Determining the signature of a permutation without trying to rearranging it for the original sequence

[edit]

Is there an algorithm to determine the signature of a permutation of a sequence without counting how many times you need to swap the elements from the original to get the permutation? (There are many ways to get the permutation, you only have to try one of them). Also write the algorithm in Python. Czech is Cyrillized (talk) 09:23, 16 June 2013 (UTC)[reply]

I don't know about Python, but in J you find answers here: [1]. Bo Jacoby (talk) 10:16, 16 June 2013 (UTC).[reply]
First find its cycle decomposition. Then the parity of the permutation is the number of even cycles. Sławomir Biały (talk) 12:07, 16 June 2013 (UTC)[reply]