Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
| Download

All published worksheets from http://sagenb.org

Views: 168822
Image: ubuntu2004
#auto load('http://dl.dropbox.com/u/789125/PP2012_GRIM_CODE/PP2012_Mesh_functions_beta1.sage') load('http://dl.dropbox.com/u/789125/PP2012_GRIM_CODE/PP2012_GRIM.sage') load('http://dl.dropbox.com/u/789125/PP2012_GRIM_CODE/PP2012_pattern_classes.sage') load('http://dl.dropbox.com/u/789125/PP2012_GRIM_CODE/PP2012_sorting_functions.sage')
# # Finding the good permutations # C = 5 prop = lambda x: is_stack_sortable(x) prop = lambda x: is_West_2_stack_sortable(x) prop = lambda x: is_factorial(x) #prop = lambda x: has_no_box_in_tableau(x) A = para_perms_sat_prop(C,prop) size_of_subdicts(A)
Perms of length 1 with this property are 1 Perms of length 2 with this property are 2 Perms of length 3 with this property are 6 Perms of length 4 with this property are 22 Perms of length 5 with this property are 89
%time # Maximum length of patterns to search for M = 4 # Maximum length of permutations from A to consider. N = C # Initializing a dictionary of good patterns that will # be learned from A goodpatts = dict() SG = parallel_guess(M,N,report=False) visualize_patts(SG,6)
CPU time: 1.19 s, Wall time: 1.19 s
# # Now seeing whether this actually gives the correct permutations # L = C patterns_suffice(SG,L,A)
# More props to play with #prop = lambda x: has_no_box_in_tableau(x) #prop = lambda x: has_no_3_2_in_tableau(x) #prop = lambda x: x.number_of_fixed_points() <= 0 # Skew-merge permutations #prop = lambda x: is_a_merge_of(x, lambda x: Permutation(x).avoids([2,1]), lambda y: Permutation(y).avoids([1,2])) # The classes used to get the bound of 16 on Av(1324) #prop = lambda x: is_a_merge_of(x, lambda x: Permutation(x).avoids([1,3,2]), lambda y: Permutation(y).avoids([2,1,3])) prop = lambda x: is_a_merge_of(x, lambda x: Permutation(x).avoids([1,3,2]) and Permutation(x).avoids([3,2,1]), lambda y: Permutation(y).avoids([2,1,3]) and Permutation(y).avoids([1,2,3])) prop = lambda x: Permutation(x).avoids([1,3,2,4]) and not is_a_merge_of(x, lambda x: Permutation(x).avoids([1,2,3]), lambda y: Permutation(y).avoids([2,1,3]) and Permutation(y).avoids([3,2,1])) prop = lambda x: Permutation(x).avoids([2,1,3]) and Permutation(x).avoids([3,2,1])
# # Pictures from talk # show ( MeshPattern ( [2, 4, 1, 3], [(0,1),(0,3),(1,0),(1,1),(1,3),(2,0),(2,1),(2,2),(2,3),(2,4),(3,0),(3,1),(3,2),(3,3),(3,4)] ), axes = False, figsize = [3,3] )
show ( MeshPattern ( [3,1,4,2], [] ), axes = False, figsize = [3,3] )
# Below are some functions we need
#auto def is_stack_sortable(perm): return stack_sort(perm) == [1..len(perm)] def is_West_2_stack_sortable(perm): return stack_sort(stack_sort(perm)) == [1..len(perm)] def is_factorial(perm): return MeshPattern([1,3,2,4],[]).avoided_by(perm) and MeshPattern([2,1,4,3],[(2,2)]).avoided_by(perm) def has_no_box_in_tableau(perm): return not any(map(lambda x: x > 1, perm.left_tableau().shape()[1:] )) def has_no_3_2_in_tableau(perm): L = perm.left_tableau().shape() if L[0] < 3: return True else: if len(L) == 1: return True else: if L[1] < 2: return True return False def is_a_merge_of(perm,prop1,prop2): return subfunc(perm,[],[],prop1,prop2) def subfunc(inp,partial1,partial2,prop1,prop2): if inp: return any( [ subfunc(inp[1:],partial1+[inp[0]],partial2,prop1,prop2), subfunc(inp[1:],partial1,partial2+[inp[0]],prop1,prop2) ] ) else: return prop1(to_standard(partial1)) and prop2(to_standard(partial2))