#C28.txt, Dec. 12, 2016, Planning the class paper Help:=proc(): print(` An(n), PatA1(pi,k), PatA(S,k) `): end: with(combinat): #inputs a list of numbers, and outputs the reduction as a permutation of nops(L) #redu([e,pi,gamma,phi, h])=[ 4, 5 , 2 , 3 ,1] redu:=proc(L) local L1,T,k,i: L1:=sort(sort(L,'output'='permutation'),'output'='permutation'): end: #The set of permutations of {1...n} defined by Big(i-1) n Small(n-i) An:=proc(n) local S,i,S1,S2,pi,pi1,pi2: option remember: if n=0 then RETURN({[]}): fi: S:={}: for i from 1 to n do S1:=An(i-1): S1:={seq(pi+[(n-i)$(i-1)],pi in S1)}: S2:=An(n-i): S:=S union {seq(seq([op(pi1),n,op(pi2)],pi1 in S1), pi2 in S2)}: od: S: end: #PatA1(pi,k): all the patterns of size k avoided in the permutation pi PatA1:=proc(pi,k) local S,n: n:=nops(pi): S:=choose([seq(i,i=1..n)],k): convert(permute(k),set) minus {seq(redu(pi[s]),s in S)}: end: #PatA(S,k): the set of patterns of length k avoided by ALL the members of S PatA:=proc(S,k) local pi: `intersect`(seq(PatA1(pi,k),pi in S)): end: