ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Mon, 28 Dec 2015 17:56:15 +0100Counting cycles of induced permutationshttps://ask.sagemath.org/question/31888/counting-cycles-of-induced-permutations/In order to do some sophisticated counting in graph theory, I need to count the cycles of some particular permutations.
In my situation, $n$ is an integer greater than 1, and $K_n$ is the set of all two-element sets {a,b} with $a, b$ being integers not greater than $n$. Now any element $\pi$ of the symmetric group $S_n$ induces a permutation $\overline{\pi}$ of $K_n$ in a natural way, i.e. $\overline{\pi}$ maps any set {a,b} of $K_n$ onto {$\pi(a)$, $\pi(b)$}. What I want to figure out with the help of SAGE is the number of cycles that the permutation $\overline{\pi}$ has.
If you can help me, please do not forget to mention those little extra things that need to be done and that might appear obvious to you (e.g. importing packages and so forth), since I am a relative novice to SAGE.
Thank you very much.
MalteMalteMon, 28 Dec 2015 17:56:15 +0100https://ask.sagemath.org/question/31888/