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.Tue, 12 Jun 2012 12:52:40 +0200S3's elementshttps://ask.sagemath.org/question/9056/s3s-elements/Here's elements of Symmetric group of 6th order: S3:
![The book says](http://farm8.staticflickr.com/7098/7358188294_242a16d3d7_z.jpg "The book says")
I want to get the same in Sage. So I do:
sage: G = SymmetricGroup(3)
sage: G.list()
[(), (2,3), (1,2), (1,2,3), (1,3,2), (1,3)]
Now I can't find (1,3,2) element in the book. As far as I understand:
P1 -> ()
P2 -> (1,2,3)
P3 -> (2,3)
P4 -> (1,2)
P5 -> (1,3)
P6 -> ??? also (1,2,3) ???
So my question is to set the correct map from sage to my book...Sun, 10 Jun 2012 13:41:13 +0200https://ask.sagemath.org/question/9056/s3s-elements/Answer by DSM for <p>Here's elements of Symmetric group of 6th order: S3:</p>
<p><img alt="The book says" src="http://farm8.staticflickr.com/7098/7358188294_242a16d3d7_z.jpg" title="The book says"/></p>
<p>I want to get the same in Sage. So I do:</p>
<pre><code>sage: G = SymmetricGroup(3)
sage: G.list()
[(), (2,3), (1,2), (1,2,3), (1,3,2), (1,3)]
</code></pre>
<p>Now I can't find (1,3,2) element in the book. As far as I understand:</p>
<pre><code>P1 -> ()
P2 -> (1,2,3)
P3 -> (2,3)
P4 -> (1,2)
P5 -> (1,3)
P6 -> ??? also (1,2,3) ???
</code></pre>
<p>So my question is to set the correct map from sage to my book...</p>
https://ask.sagemath.org/question/9056/s3s-elements/?answer=13685#post-id-13685The results of
sage: G = SymmetricGroup(3)
sage: G.list()
[(), (2,3), (1,2), (1,2,3), (1,3,2), (1,3)]
are given in [cycle notation](http://en.wikipedia.org/wiki/Cycle_notation). So the book's equivalent of (1,3,2) is one where 1 becomes 3, 3 becomes 2, and 2 becomes 1, which is P6, if I'm reading correctly.
If you want to match the bottom three elements of your matrix, you can simply convert each to a list, or maybe a dict would make the mapping more explicit:
sage: for g in G:
....: print g, g.list(), g.dict()
....:
() [1, 2, 3] {1: 1, 2: 2, 3: 3}
(2,3) [1, 3, 2] {1: 1, 2: 3, 3: 2}
(1,2) [2, 1, 3] {1: 2, 2: 1, 3: 3}
(1,2,3) [2, 3, 1] {1: 2, 2: 3, 3: 1}
(1,3,2) [3, 1, 2] {1: 3, 2: 1, 3: 2}
(1,3) [3, 2, 1] {1: 3, 2: 2, 3: 1}
Sun, 10 Jun 2012 15:26:56 +0200https://ask.sagemath.org/question/9056/s3s-elements/?answer=13685#post-id-13685Comment by bk322 for <p>The results of </p>
<pre><code>sage: G = SymmetricGroup(3)
sage: G.list()
[(), (2,3), (1,2), (1,2,3), (1,3,2), (1,3)]
</code></pre>
<p>are given in <a href="http://en.wikipedia.org/wiki/Cycle_notation">cycle notation</a>. So the book's equivalent of (1,3,2) is one where 1 becomes 3, 3 becomes 2, and 2 becomes 1, which is P6, if I'm reading correctly. </p>
<p>If you want to match the bottom three elements of your matrix, you can simply convert each to a list, or maybe a dict would make the mapping more explicit:</p>
<pre><code>sage: for g in G:
....: print g, g.list(), g.dict()
....:
() [1, 2, 3] {1: 1, 2: 2, 3: 3}
(2,3) [1, 3, 2] {1: 1, 2: 3, 3: 2}
(1,2) [2, 1, 3] {1: 2, 2: 1, 3: 3}
(1,2,3) [2, 3, 1] {1: 2, 2: 3, 3: 1}
(1,3,2) [3, 1, 2] {1: 3, 2: 1, 3: 2}
(1,3) [3, 2, 1] {1: 3, 2: 2, 3: 1}
</code></pre>
https://ask.sagemath.org/question/9056/s3s-elements/?comment=19619#post-id-19619That's very cool. I did this: `for e in sorted(G): print '{0:>8s}{1:>10s}{2:>19s}'.format(e, e.list(), e.dict())` (I type more then, but it inserts >...)Tue, 12 Jun 2012 12:52:40 +0200https://ask.sagemath.org/question/9056/s3s-elements/?comment=19619#post-id-19619