# Check that P3*P6=P4

Here's elements of Symmetric group of 6th order: S3: I want to check that P3*P6=P4.

G = SymmetricGroup(3)

BookNumbers = [1, 4, 2, 3, 6, 5]

P = 
for i in BookNumbers:
P.append(sorted(G.list())[i-1])

print (P * P).list(), P.list()
print (P * P) == P


it gives:

[3, 2, 1] [2, 1, 3]
False


so they are the same actually. But how do I make sage say True?.

edit retag close merge delete

Sort by » oldest newest most voted

The problem is that you are comparing lists, not Sage objects. achrzesz gives an answer which compares two Sage group elements, so they are equal. The lists you give are simple Python ordered lists, and as ordered things, certainly aren't the same. Why didn't you just compare P*P and P?

By the way, they're not the same. But that's a different issue. They're using the notation of the second row of your notation in your original question, not cycle notation.

sage: P * P
(1,3)
sage: P
(1,2)

more
sage: G = SymmetricGroup(3)
sage: P3=G((3,2))
sage: P6=G((3,1,2))
sage: P4=G((2,1))
sage: P3*P6==P4
True

more

But mine are also the same. [3, 2, 1] is same as [2, 1, 3], isn't it?