Ask Your Question

Thruston's profile - activity

2020-04-06 07:45:46 -0500 received badge  Famous Question (source)
2018-10-10 16:38:38 -0500 received badge  Notable Question (source)
2018-10-10 16:38:38 -0500 received badge  Popular Question (source)
2012-10-05 04:00:07 -0500 commented answer Order of elements in group multiplication?

thank you.

2012-10-04 05:35:24 -0500 received badge  Student (source)
2012-10-04 00:28:52 -0500 asked a question Order of elements in group multiplication?

This is probably a very simple mistake on my part, but can anyone please explain this error in Sage?

If I do this...

sage: G = SymmetricGroup(3)
sage: H = AlternatingGroup(3)

then this works as expected:

sage: [(g*h) for h in H for g in G]
[(), (2,3), (1,2), (1,2,3), (1,3,2), (1,3), (1,2,3), (1,2), (1,3), (1,3,2), (), (2,3), (1,3,2), (1,3), (2,3), (), (1,2,3), (1,2)]

but if I reverse the order of h and g I get an error

sage: [(h*g) for h in H for g in G]
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
/Users/toby/<ipython console> in <module>()
/Applications/Sage-4.8-OSX-64bit-10.6.app/Contents/Resources/sage/local/lib/python2.6/site-packages/sage/structure/element.so in sage.structure.element.MonoidElement.__mul__ (sage/structure/element.c:10197)()
/Applications/Sage-4.8-OSX-64bit-10.6.app/Contents/Resources/sage/local/lib/python2.6/site-packages/sage/structure/element.so in sage.structure.element.MonoidElement.__mul__ (sage/structure/element.c:10056)()
/Applications/Sage-4.8-OSX-64bit-10.6.app/Contents/Resources/sage/local/lib/python2.6/site-packages/sage/structure/coerce.so in sage.structure.coerce.CoercionModel_cache_maps.bin_op (sage/structure/coerce.c:7467)()
TypeError: unsupported operand parent(s) for '*': 'Alternating group of order 3!/2 as a permutation group' and 'Symmetric group of order 3! as a permutation group'

Can anyone explain what I am doing wrong? Thanks Toby