/* Programs to calculate information on the red, yellow and green words at various distances from the identity. Also calculates orbits of M12 acting by conjugation on these words. Code for distance 7 has been commented out. */ ttt:=Cputime(); G:=PermutationGroup<12|(1,2,3,4,5,6,7,8,9,10,11),(3,4)(2,10)(6,7)(5,9),(11,12)(1,10)(2,5)(3,7)(4,8)(6,9)>; M12:=G; // G = M12. B:=Base(G); // Not used below. hamdist:=func; // Not used either. id:=[1,2,3,4,5,6,7,8,9,10,11,12]; g:="Green";y:="Yellow";r:="Red"; function c(w,pi);pii:=pi^-1;return [w[i^pii]^pi:i in [1..12]];end function; print "Replace path below by something suitable."; load "XXXXXXXX/Unc12.5.n"; function col(w); if Type(w) ne SeqEnum or #w ne 12 then error "Incorrect input";end if; if not (Set(w) subset {1..12}) then error "Incorrect input";end if; nw:=#Set(w);di:=hamdist(w,id); if nw le 4 then dm:=12-nw;cc:="Yellow"; return cc,di,dm,_; else // dist <= 4. UU:=[u:u in U4|#{w[i]:i in u} eq 5]; UU:=[Eltseq(p2) where p1,p2:=IsConjugate(M12,u,[w[i]:i in u]):u in UU]; UU:=Setseq(Set(UU)); UU:=[hamdist(w,u):u in UU]; if #UU ne 0 and Min(UU) le 4 then dm:=Min(UU);nn:=#[u:u in UU|u eq dm]; if di gt dm then cc:="Red";elif nn gt 1 then cc:="Yellow";else cc:="Green";end if; return cc,di,dm,nn;end if; // dist <= 5. UU:=[u:u in U5|#{w[i]:i in u} eq 5]; UU:=[Eltseq(p2) where p1,p2:=IsConjugate(M12,u,[w[i]:i in u]):u in UU]; UU:=Setseq(Set(UU)); UU:=[hamdist(w,u):u in UU]; if #UU ne 0 and Min(UU) le 5 then dm:=Min(UU);nn:=#[u:u in UU|u eq dm]; if di gt dm then cc:="Red";elif nn gt 1 then cc:="Yellow";else cc:="Green";end if; return cc,di,dm,nn;end if; // dist <= 6. UU:=[u:u in U6|#{w[i]:i in u} eq 5]; UU:=[Eltseq(p2) where p1,p2:=IsConjugate(M12,u,[w[i]:i in u]):u in UU]; UU:=Setseq(Set(UU)); UU:=[hamdist(w,u):u in UU]; if #UU ne 0 and Min(UU) le 6 then dm:=Min(UU);nn:=#[u:u in UU|u eq dm]; if di gt dm then cc:="Red";elif nn gt 1 then cc:="Yellow";else cc:="Green";end if; return cc,di,dm,nn;end if; // dist <= 7. UU:=[u:u in U7|#{w[i]:i in u} eq 5]; UU:=[Eltseq(p2) where p1,p2:=IsConjugate(M12,u,[w[i]:i in u]):u in UU]; UU:=Setseq(Set(UU)); UU:=[hamdist(w,u):u in UU]; if #UU ne 0 and Min(UU) le 7 then dm:=Min(UU);nn:=#[u:u in UU|u eq dm]; if di gt dm then cc:="Red";elif nn gt 1 then cc:="Yellow";else cc:="Green";end if; return cc,di,dm,nn;end if; // end if; end function; S0:=Stabiliser(M12,{}); S1:=Stabiliser(M12,{1}); S2:=Stabiliser(M12,{1,2}); S3:=Stabiliser(M12,{1,2,3}); S4:=Stabiliser(M12,{1,2,3,4}); S5:=Stabiliser(M12,{1,2,3,4,5}); S6h:=Stabiliser(M12,{1,2,3,4,5,7}); S6n:=Stabiliser(M12,{1,2,3,4,5,6}); S7:=Stabiliser(M12,{1,2,3,4,5,6,7}); W0:=[[1,2,3,4,5,6,7,8,9,10,11,12]]; // tt:=Cputime(); // W4:=[[i1,i2,i3,i4,5,6,7,8,9,10,11,12]:i4 in [1..12],i3 in [1..12],i2 in [1..12],i1 in [1..12]|i1 ne 1 and i2 ne 2 and i3 ne 3 and i4 ne 4];#W4; // W4:=[u:u in W4|u eq Min({c(u,pi):pi in S4})];#W4; // Cputime(tt); tt:=Cputime(); W1:=[[i1,2,3,4,5,6,7,8,9,10,11,12]:i1 in [2]];#W1; WW:=W1;W1:=[]; while #WW ne 0 do w:=WW[1];Append(~W1,w);ww:={c(w,pi):pi in S1}; WW:=[u:u in WW|u notin ww];// #W1,"\t",#WW,"\t",#ww; end while; Cputime(tt); tt:=Cputime(); W2:=[[i1,i2,3,4,5,6,7,8,9,10,11,12]:i2 in [1..12],i1 in [2,3]|i2 ne 2];#W2; WW:=W2;W2:=[]; while #WW ne 0 do w:=WW[1];Append(~W2,w);ww:={c(w,pi):pi in S2}; WW:=[u:u in WW|u notin ww];// #W2,"\t",#WW,"\t",#ww; end while; Cputime(tt); tt:=Cputime(); W3:=[[i1,i2,i3,4,5,6,7,8,9,10,11,12]:i3 in [1..12],i2 in [1..12],i1 in [2,4]|i2 ne 2 and i3 ne 3];#W3; WW:=W3;W3:=[]; while #WW ne 0 do w:=WW[1];Append(~W3,w);ww:={c(w,pi):pi in S3}; WW:=[u:u in WW|u notin ww];// #W3,"\t",#WW,"\t",#ww; end while; Cputime(tt); tt:=Cputime(); W4:=[[i1,i2,i3,i4,5,6,7,8,9,10,11,12]:i4 in [1..12],i3 in [1..12],i2 in [1..12],i1 in [2,5]|i2 ne 2 and i3 ne 3 and i4 ne 4];#W4; for i in [1..3] do x:=Random(S4);W4:=[u:u in W4|u le c(u,x)]; printf "%o ",#W4;end for;printf "\n"; WW:=W4;W4:=[]; while #WW ne 0 do w:=WW[1];Append(~W4,w);ww:={c(w,pi):pi in S4}; WW:=[u:u in WW|u notin ww];// #W4,"\t",#WW,"\t",#ww; end while; Cputime(tt); tt:=Cputime(); W5:=[[i1,i2,i3,i4,i5,6,7,8,9,10,11,12]:i5 in [1..12],i4 in [1..12],i3 in [1..12],i2 in [1..12],i1 in [2,6,7]|i2 ne 2 and i3 ne 3 and i4 ne 4 and i5 ne 5];#W5; SS5:=Setseq(Set(S5));for x in SS5 do W5:=[u:u in W5|u le c(u,x)]; printf "%o ",#W5;end for;printf "\n"; Cputime(tt); tt:=Cputime(); W6:=[[i1,i2,i3,i4,i5,i6,7,8,9,10,11,12]:i6 in [1..12],i5 in [1..12],i4 in [1..12],i3 in [1..12],i2 in [1..12],i1 in [2,7,8]|i2 ne 2 and i3 ne 3 and i4 ne 4 and i5 ne 5 and i6 ne 6];#W6; SS6:=Setseq(Set(S6n));for x in SS6 do W6:=[u:u in W6|u le c(u,x)]; printf "%o ",#W6;end for;printf "\n"; Cputime(tt); W6n:=W6; tt:=Cputime(); W6:=[[i1,i2,i3,i4,i5,6,i7,8,9,10,11,12]:i7 in [1..12],i5 in [1..12],i4 in [1..12],i3 in [1..12],i2 in [1..12],i1 in [2,6]|i2 ne 2 and i3 ne 3 and i4 ne 4 and i5 ne 5 and i7 ne 7];#W6; SS6:=Setseq(Set(S6h));for x in SS6 do W6:=[u:u in W6|u le c(u,x)]; printf "%o ",#W6;end for;printf "\n"; Cputime(tt); W6h:=W6; /* tt:=Cputime(); W7:=[[i1,i2,i3,i4,i5,i6,i7,8,9,10,11,12]:i7 in [1..12],i6 in [1..12],i5 in [1..12],i4 in [1..12],i3 in [1..12],i2 in [1..12],i1 in [2,6,8]|i2 ne 2 and i3 ne 3 and i4 ne 4 and i5 ne 5 and i6 ne 6 and i7 ne 7];#W7; SS7:=Setseq(Set(S7));for x in SS7 do W7:=[u:u in W7|u le c(u,x)]; printf "%o ",#W7;end for;printf "\n"; Cputime(tt); */ tt:=Cputime(); SE0:=[];SE1:=[];SE2:=[];SE3:=[];SE4:=[];SE5:=[];SE6h:=[];SE6n:=[];SE7:=[]; time for u in W0 do cc,di,dm,nn:=col(u);no:=#{c(u,pi):pi in S0};Append(~SE0,);end for; time for u in W1 do cc,di,dm,nn:=col(u);no:=#{c(u,pi):pi in S1};Append(~SE1,);end for; time for u in W2 do cc,di,dm,nn:=col(u);no:=#{c(u,pi):pi in S2};Append(~SE2,);end for; time for u in W3 do cc,di,dm,nn:=col(u);no:=#{c(u,pi):pi in S3};Append(~SE3,);end for; time for u in W4 do cc,di,dm,nn:=col(u);no:=#{c(u,pi):pi in S4};Append(~SE4,);end for; time for u in W5 do cc,di,dm,nn:=col(u);no:=#{c(u,pi):pi in S5};Append(~SE5,);end for; time for u in W6h do cc,di,dm,nn:=col(u);no:=#{c(u,pi):pi in S6h};Append(~SE6h,);end for; time for u in W6n do cc,di,dm,nn:=col(u);no:=#{c(u,pi):pi in S6n};Append(~SE6n,<-di,792,no,cc,dm,nn,u>);end for; // time for u in W7 do cc,di,dm,nn:=col(u);no:=#{c(u,pi):pi in S7};Append(~SE7,);end for; Cputime(tt); Cputime(ttt);