Code : Tout sélectionner
#model Rubik's Cube en GAP
# 5 6 7
# 4 H 8
# 3 2 1
# 25 28 23 | 21 26 19 | 17 32 31 | 29 30 27
# 38 G 36 | 12 A 10 | 34 D 40 | 16 P 14
# 43 44 37 | 39 42 33 | 35 48 45 | 47 46 41
# 11 18 9
# 20 B 24
# 13 22 15
# H=49,B=50,A=51,P=52,G=53,D=54
# Rubik=le groupe des permutations du Rubik's Cube
Print("\n\n");
pH := (2,4,6,8)(26,28,30,32) (1,3,5,7)(17,21,25,29)(19,23,27,31) ;
pB := (18,24,22,20)(42,48,46,44) (9,15,13,11)(33,45,41,37)(35,47,43,39);
pA := (2,34,18,36)(26,10,42,12) (1,35,11,23)(17,9,37,3)(19,33,39,21);
pP := (6,38,22,40)(30,14,46,16) (7,25,13,45)(29,27,41,47)(31,5,43 ,15);
pG := (4,12,20,14)(28,36,44,38) (3,39,13,27)(21,11,41,5)(23,37,43,25);
pD := (8,16,24,10)(32,40,48,34) (1,29,15,33)(17,31,45,35)(19,7,47,9);
Rubik := Group(pH,pB,pA,pP,pG,pD);
#Orbits( Rubik, [1..48],OnPoints ) ;
sommet := [ 1, 3, 35, 29, 5, 17, 39, 47, 11, 27, 15, 7, 43, 21, 9, 31, 13, 23, 41,
33, 25, 19, 37, 45 ];
arete := [ 2, 4, 34, 6, 12, 18, 32, 8, 38, 26, 20, 24, 36, 40, 16, 22, 28, 10, 14,
44, 48, 30, 42, 46 ];
pHa := RestrictedPerm(pH,arete) ;
pBa := RestrictedPerm(pB,arete) ;
pAa := RestrictedPerm(pA,arete) ;
pPa := RestrictedPerm(pP,arete) ;
pGa := RestrictedPerm(pG,arete) ;
pDa := RestrictedPerm(pD,arete) ;
Tori := Group(pHa,pBa,pAa,pPa,pGa,pDa);;
Print("\n\n Tori"," = ", Size(Tori), "\n" );
pHs := RestrictedPerm(pH,sommet);
pBs := RestrictedPerm(pB,sommet);
pAs := RestrictedPerm(pA,sommet);
pPs := RestrictedPerm(pP,sommet);
pGs := RestrictedPerm(pG,sommet);
pDs := RestrictedPerm(pD,sommet);
Pocket := Group(pHs,pBs,pAs,pPs,pGs,pDs);;
Print("\n\n Pocket"," = ", Size(Pocket), "\n" );
