Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
18 views
##### QUESTION 4 ##### S48=SymmetricGroup(48) Ordre = S48.order() Ordre nbDix = 0 while(Ordre > 10): Ordre = Ordre / 10 nbDix = nbDix + 1 nbDix float(Ordre)
12413915592536072670862289047373375038521486354677760000000000 61 1.2413915592536073
##### QUESTION 9 ##### #Tests avec CubeGroup() GRubik=CubeGroup() #GRubik.order()
#Tests avec RubiksCube() Rubik=RubiksCube() #Rubik.show3d() Rubik.show() Rubik.move("U").show() Rubik.move("U").move("R").show()
##### QUESTION 11 ##### sU=GRubik.U() sL=GRubik.L() sF=GRubik.F() sR=GRubik.R() sB=GRubik.B() sD=GRubik.D() #Notation en permutations [n for n in range(1, 49)] print map(sU, range(1, 49)) [n for n in range(1, 49)] print map(sL, range(1, 49)) [n for n in range(1, 49)] print map(sF, range(1, 49)) [n for n in range(1, 49)] print map(sR, range(1, 49)) [n for n in range(1, 49)] print map(sB, range(1, 49)) [n for n in range(1, 49)] print map(sD, range(1, 49)) #Notation en cycles sU sL sF sR sB sD #Resultat des 6 permutations elementaires #Resultat les produits 4-cycles correspondant aux permutations elementaires
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48] [3, 5, 8, 2, 7, 1, 4, 6, 33, 34, 35, 12, 13, 14, 15, 16, 9, 10, 11, 20, 21, 22, 23, 24, 17, 18, 19, 28, 29, 30, 31, 32, 25, 26, 27, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48] [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48] [17, 2, 3, 20, 5, 22, 7, 8, 11, 13, 16, 10, 15, 9, 12, 14, 41, 18, 19, 44, 21, 46, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 6, 36, 4, 38, 39, 1, 40, 42, 43, 37, 45, 35, 47, 48] [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48] [1, 2, 3, 4, 5, 25, 28, 30, 9, 10, 8, 12, 7, 14, 15, 6, 19, 21, 24, 18, 23, 17, 20, 22, 43, 26, 27, 42, 29, 41, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 11, 13, 16, 44, 45, 46, 47, 48] [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48] [1, 2, 38, 4, 36, 6, 7, 33, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 3, 20, 5, 22, 23, 8, 27, 29, 32, 26, 31, 25, 28, 30, 48, 34, 35, 45, 37, 43, 39, 40, 41, 42, 19, 44, 21, 46, 47, 24] [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48] [14, 12, 9, 4, 5, 6, 7, 8, 46, 10, 11, 47, 13, 48, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 1, 28, 2, 30, 31, 3, 35, 37, 40, 34, 39, 33, 36, 38, 41, 42, 43, 44, 45, 32, 29, 27] [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48] [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 22, 23, 24, 17, 18, 19, 20, 21, 30, 31, 32, 25, 26, 27, 28, 29, 38, 39, 40, 33, 34, 35, 36, 37, 14, 15, 16, 43, 45, 48, 42, 47, 41, 44, 46] (1,3,8,6)(2,5,7,4)(9,33,25,17)(10,34,26,18)(11,35,27,19) (1,17,41,40)(4,20,44,37)(6,22,46,35)(9,11,16,14)(10,13,15,12) (6,25,43,16)(7,28,42,13)(8,30,41,11)(17,19,24,22)(18,21,23,20) (3,38,43,19)(5,36,45,21)(8,33,48,24)(25,27,32,30)(26,29,31,28) (1,14,48,27)(2,12,47,29)(3,9,46,32)(33,35,40,38)(34,37,39,36) (14,22,30,38)(15,23,31,39)(16,24,32,40)(41,43,48,46)(42,45,47,44)
#QUESTION 16 GRubik.solve(GRubik("(7,18) (4,10)")) #QESTION 18 print S48("(4,10)") in GRubik print S48("(7,18) (4,10)") in GRubik #Avec basculement : print S48("(7,34) (18,2)") in GRubik #Sans basculement : print S48("(7,2) (34,18)") in GRubik print S48("(6,11,17)") in GRubik #Avec rotation : print S48("(3,6) (17,27) (11,33)") in GRubik #Sans rotation : print S48("(3,6) (17,27) (11,33)") in GRubik
"F2 L2 B F D F' D' B' L2 F L F L'" False True False False False False False
#QUESTION 19 # vérifions que fS est surjective ll=map(fS,GRubik.gens()) GCS=S8.subgroup(ll) print GCS.order() print GCS==S8 () # vérifions que fS est un morphisme m1=GRubik.random_element() m2=GRubik.random_element() print 'm1 = ', m1 print 'fS(m1) = ', fS(m1) print 'm2 = ', m2 print 'fS(m2) = ', fS(m2) print fS(m1*m2)==fS(m1)*fS(m2)
Error in lines 3-3 Traceback (most recent call last): File "/projects/sage/sage-6.10/local/lib/python2.7/site-packages/smc_sagews/sage_server.py", line 905, in execute exec compile(block+'\n', '', 'single') in namespace, locals File "", line 1, in <module> NameError: name 'fS' is not defined
#QUESTION 20 S8=SymmetricGroup(8) CS=[[8,25,19],[6,17,11],[1,9,35],[3,33,27],[43,24,30],[41,16,22], [46,40,14],[48,32,38]] Z3=Zmod(3) sCS=map(set,CS) def rotS(s): rs=[Z3.zero() for k in range(len(CS))] for k in range(len(CS)): b=map(s,CS[k]) a=CS[sCS.index(set(b))] if b[0]==a[0]: pass # ne fait rien elif b[1]==a[0]: rs[k]=Z3.one() elif b[2]==a[0]: rs[k]=Z3(2) else: print 'Erreur !!' return rs sCS=map(set,CS) # pour oublier l'orientation des sommets def fS(s): # retourne la permutation des sommets # induite par le mouvement s # comme élément de S8 return S8([sCS.index(set(map(s,CS[k])))+1 for k in range(len(CS))])
print 'fS(sU) = ', fS(sU), 'rotS(sU) = ', rotS(sU) print 'fS(sL) = ', fS(sL), 'rotS(sL) = ', rotS(sL) print 'fS(sF) = ', fS(sF), 'rotS(sF) = ', rotS(sF) print 'fS(sR) = ', fS(sR), 'rotS(sR) = ', rotS(sR) print 'fS(sB) = ', fS(sB), 'rotS(sB) = ', rotS(sB) print 'fS(sD) = ', fS(sD), 'rotS(sD) = ', rotS(sD) sumRot=[] for i in range(8): sumRot.append((rotS(sU)[i]+rotS(sL)[i]+rotS(sF)[i]+rotS(sD)[i]+rotS(sB)[i]+rotS(sR)[i]) % 3) sumRot # rotS n'est pas un morphisme pour (Z3^8,+,0) rotS(sF*sR) == map(lambda x,y: x+y,rotS(sF),rotS(sR)) rotS(sF*sR)
fS(sU) = (1,2,3,4) rotS(sU) = [0, 0, 0, 0, 0, 0, 0, 0] fS(sL) = (2,6,7,3) rotS(sL) = [0, 1, 2, 0, 0, 2, 1, 0] fS(sF) = (1,5,6,2) rotS(sF) = [1, 2, 0, 0, 2, 1, 0, 0] fS(sR) = (1,4,8,5) rotS(sR) = [2, 0, 0, 1, 1, 0, 0, 2] fS(sB) = (3,7,8,4) rotS(sB) = [0, 0, 1, 2, 0, 0, 2, 1] fS(sD) = (5,8,7,6) rotS(sD) = [0, 0, 0, 0, 0, 0, 0, 0] [0, 0, 0, 0, 0, 0, 0, 0] False [2, 1, 0, 1, 2, 1, 0, 2]
# rotation d'une composée de 2 mouvements m1=GRubik.random_element() m2=GRubik.random_element() print 'm1 = ', m1 print 'rotS(m1) = ', rotS(m1) print 'm2 = ', m2 print 'rotS(m2) = ', rotS(m2) print 'rotS(m1*m2) = ', rotS(m1*m2) print rotS(m1*m2) == map(lambda x,y: x+y,rotS(m1),fS(m1)(rotS(m2))) # l'orientation totale est conservée m=GRubik.random_element() print 'm =', m print 'rotS(m) = ', rotS(m) print sum(rotS(m))
m1 = (1,33,6,40,43,48)(2,34)(3,11,46,30,38,35)(4,12,45,44,13,23,18,5,47,21,29,10,37,31,15,20,42,7,26,39,28,36)(8,41)(9,27,17,14,24,32)(16,25)(19,22) rotS(m1) = [0, 2, 2, 1, 0, 0, 1, 0] m2 = (1,48,22)(2,44,39,42,45,7,12,20,10)(3,6,43,46,25)(4,34,15,47,23,31,18,37,13)(5,28,29)(8,27,11,30,14)(9,32,41)(16,35,38)(17,24,40,19,33)(21,36,26) rotS(m2) = [1, 0, 0, 0, 0, 2, 2, 1] rotS(m1*m2) = [2, 1, 2, 1, 1, 1, 1, 0] True m = (1,24,22)(2,42,47,7,13,36,12,4,21,45,5,15)(3,38,27,32,33,48)(6,25,40,17,19,14,11,8,46)(9,30,41)(10,28,31,26,44,34,23,39,18,20,29,37)(16,35,43) rotS(m) = [0, 2, 2, 1, 2, 2, 0, 0] 0
#QUESTION 21 def psiS(sigma): return (rotS(sigma),fS(sigma)) print 'psiS(m1) = ', psiS(m1) print 'psiS(m2) = ', psiS(m2) print 'psiS(m1 o m2) = ', psiS(m1*m2)
psiS(m1) = ([0, 2, 2, 1, 0, 0, 1, 0], (1,6)(2,7,5,8,3,4)) psiS(m2) = ([1, 0, 0, 0, 0, 2, 2, 1], (1,4,2,5,7)(3,8,6)) psiS(m1 o m2) = ([2, 1, 2, 1, 1, 1, 1, 0], (1,3,2)(4,5,6))
#QUESTION 24 CA=[[7,18],[4,10],[2,34],[5,26],[28,21],[13,20],[12,37],[29,36],[42,23],[44,15],[47,39],[45,31]] S12=SymmetricGroup(12) sCA=map(set,CA) # pour oublier l'orientation des arretes def fA(s): # retourne la permutation des arêtes # induite par le mouvement s # comme élément de S12 return S12([sCA.index(set(map(s,CA[k])))+1 for k in range(len(CA))]) print 'fA(sU) = ', fA(sU) print 'fA(sF) = ', fA(sF) print 'fA(sU*sF) = ', fA(sU*sF)
fA(sU) = (1,2,3,4) fA(sF) = (1,5,9,6) fA(sU*sF) = (1,2,3,4,5,9,6)
# vérifions que fA est un morphisme m1=GRubik.random_element() m2=GRubik.random_element() print 'm1 = ', m1 print 'fA(m1) = ', fS(m1) print 'm2 = ', m2 print 'fA(m2) = ', fS(m2) print fS(m1*m2)==fS(m1)*fS(m2)
m1 = (1,24,17,27,19,38,22)(2,10,5)(3,8,48,41,9,30,11)(4,26,34)(6,33,25,32,16,35,43)(7,18)(12,28,23,20,29,47,44,37,21,42,13,36,39,15) fA(m1) = (1,8,6,3,5,2,4) m2 = (1,40,22,27,6,19,30,35,46,16,33,11,25,24,9,14,41,3,17,8,43)(2,39,13,31,29,5,23,10,21,18)(4,28,7,34,47,20,45,36,26,42)(12,15)(32,38,48)(37,44) fA(m2) = (1,5,3,7,6,4,2) True
# vérifions que fA est surjective ll=map(fA,GRubik.gens()) GCA=S12.subgroup(ll) print GCA.order() print GCA==S12
479001600 True
Z2=Zmod(2) sCA=map(set,CA) # pour oublier l'orientation des arretes def rotA(s): rs=[Z2.zero() for k in range(len(CA))] for k in range(len(CA)): b=map(s,CA[k]) a=CA[sCA.index(set(b))] if b[0]==a[0]: pass # ne fait rien elif b[1]==a[0]: rs[k]=Z2.one() else: print 'Erreur !!' return rs
print 'fA(sU) = ', fA(sU), 'rotA(sU) = ', rotA(sU) print 'fA(sL) = ', fA(sL), 'rotA(sL) = ', rotA(sL) print 'fA(sF) = ', fA(sF), 'rotA(sF) = ', rotA(sF) print 'fA(sR) = ', fA(sR), 'rotA(sR) = ', rotA(sR) print 'fA(sB) = ', fA(sB), 'rotA(sB) = ', rotA(sB) print 'fA(sD) = ', fA(sD), 'rotA(sD) = ', rotA(sD) sumRotA=[] for i in range(12): sumRotA.append((rotA(sU)[i]+rotA(sL)[i]+rotA(sF)[i]+rotA(sD)[i]+rotA(sB)[i]+rotA(sR)[i]) % 2) sumRotA # rotA n'est pas un morphisme pour (Z2^8,+,0) rotA(sF*sR) == map(lambda x,y: x+y,rotA(sF),rotA(sR)) rotA(sF*sR) () m4= GRubik.random_element() print (m4) print rotA(m4) print sum(rotA(m4))
fA(sU) = (1,2,3,4) rotA(sU) = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] fA(sL) = (2,6,10,7) rotA(sL) = [0, 1, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0] fA(sF) = (1,5,9,6) rotA(sF) = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] fA(sR) = (4,8,12,5) rotA(sR) = [0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1] fA(sB) = (3,7,11,8) rotA(sB) = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] fA(sD) = (9,12,11,10) rotA(sD) = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] [0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1] False [1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1] () (1,14,17,24,9,46,11,30,35,40,6,43)(2,20,31,36,23,10)(3,16,33,22,27,41)(4,34,13,45,29,42)(5,15,18,47,28)(7,39,21,26,44)(8,32,25,38,19,48) [1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0] 0
# rotation d'une composée de 2 mouvements m1=GRubik.random_element() m2=GRubik.random_element() print 'm1 = ', m1 print 'rotA(m1) = ', rotA(m1) print 'm2 = ', m2 print 'rotA(m2) = ', rotA(m2) print 'rotA(m1*m2) = ', rotA(m1*m2) print rotA(m1*m2) == map(lambda x,y: x+y,rotA(m1),fA(m1)(rotA(m2))) # l'orientation totale est conservée m=GRubik.random_element() print 'm =', m print 'rotA(m) = ', rotA(m) print sum(rotA(m))
m1 = (1,22,46,32,30,8,9,41,40,38,43,25,35,16,14,48,24,19)(2,10,28,12,15,39,18,20,31)(3,6,27,11,33,17)(4,21,37,44,47,7,13,45,34)(5,26)(23,42) rotA(m1) = [0, 1, 1, 1, 0, 0, 1, 0, 1, 0, 0, 1] m2 = (1,6,38,19)(2,47,28,7,23,44,20,37,10)(3,16,27,41,33,22)(4,34,39,21,18,42,15,13,12)(5,31,36)(8,9,17,48)(11,32,25,35)(14,46,40)(26,45,29) rotA(m2) = [1, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0] rotA(m1*m2) = [0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1] True m = (1,25,16,6,35,8,41,11,9,19,22,17)(2,34)(3,33,27)(4,31,39,12,42,29)(5,21)(7,18)(10,45,47,37,23,36)(14,43,40,30,46,24)(26,28)(32,38,48) rotA(m) = [1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0] 0