#C26.txt, April 28, 2025 Help26:=proc(): print(`MultP(pi,sig), GenGp(S), CtoP(C) , IndPer(pi), CIPkn(n,x), ParToPer(P), CIPknC(n,x) `):end: read `AGT.txt`: #MultP(pi,sig): the product of the permutation pi and sig MultP:=proc(pi,sig) local i: [seq(pi[sig[i]],i=1..nops(pi))]: end: #GenGp(S): inputs a set of permutations (all of the same length, nops(S[1])) outputs #the subset of S_n generated by S GenGp:=proc(S) local N,G1,i,s,g1,n,G2,G3: if S={} then RETURN(FAIL): fi: n:=nops(S[1]): G1:={[seq(i,i=1..n)]}: G2:=G1 union {seq(seq(MultP(g1,s),g1 in G1),s in S)}: while G1<>G2 do G3:=G2 union {seq(seq(MultP(g1,s),g1 in G2),s in S)}: G1:=G2: G2:=G3: od: G2: end: #CtoP(C): Given a permutation in CYCLE notation (a set of list) converts it to one-line notation CtoP:=proc(C) local i,T,j,n,c: n:=add(nops(c), c in C): for i from 1 to nops(C) do c:=C[i]: for j from 1 to nops(c)-1 do T[c[j]]:=c[j+1]: od: T[c[nops(c)]]:=c[1]: od: [seq(T[i],i=1..n)]: end: #IndPer(pi): inputs a permuation pi on the set of VERTICES of K_n #outputs the member of S_binomial(n,2) , a certaion permutation on the #set of edges INDUCED by pi IndPer:=proc(pi) local n, Ed, i,j,T,r,T1: n:=nops(pi): Ed:=[seq(seq({i,j},j=i+1..n),i=1..n)]: for r from 1 to nops(Ed) do T1[Ed[r]]:=r: od: for r from 1 to nops(Ed) do T[Ed[r]]:={pi[Ed[r][1]],pi[Ed[r][2]]}: od: [seq(T1[T[Ed[r]]],r=1..nops(Ed))]: end: #CIPkn(n,x): the cycle-index polynomial for K_n #A88 CIPkn:=proc(n,x) local S,pi: S:=permute(n): add(WtP(IndPer(pi),x),pi in S)/n!: end: #added after class #ParToPer(P): Given a partion P of an integer n (a member of Pars1(n,n)) outputs the "canononical permuation" of that type ParToPer:=proc(P) local n,cu,i,j,r,C,c: n:=nops(P): C:={}: cu:=1: for i from 1 to n do for j from 1 to P[i] do c:=[seq(r,r=cu..cu+i-1)]: C:=C union {c}: cu:=cu+i: od: od: CtoP(C): end: #CIPknC(n,x): the cycle-index polynomial for K_n done cleverly CIPknC:=proc(n,x) local S,pi: S:=Pars1(n,n): add(Mult(s)*WtP(IndPer(ParToPer(s)),x),s in S)/n!: end: