# Matthew Russell # Experimental Math # Homework 23 # I give permission to post this read `public_html/em12/hw22.txt`: read `public_html/em12/C22.txt`: read `public_html/em12/C13.txt`: ##################################################################################### # Write a procedure PT() (PT for Periodic Table), that inputs nothing, # and outputs the set of Conway's 92 elements. Verify that indeed you got 92 of them. # Hint: Start with [3], and keep applying SplitUp(L), of the previous homework assignment, # that is based on the true/false procedure # split(w1,w2) # that you should use as a black box. PT:=proc() local els, needtodo, n, S: option remember: els:={}: needtodo:={[3]}: while needtodo<>{} do n:=needtodo[1]: needtodo:=needtodo minus {n}: els:=els union {n}: S:=SplitUp(JC1(n)): needtodo:=needtodo union (convert(S,set) minus els): od: return els: end: ##################################################################################### # Write a procedure Mat(), that inputs nothing, and outputs the 0-1 matrix such that # entry (i,j) has a 1 if and only if the "molecule" (that may be an atom) # JC1(w) # applied to atom i, has atom j in it. Mat:=proc() local P, M, i, curr, j, k: P:=PT(): M:=Matrix(nops(P)): for i from 1 to nops(P) do curr:=convert(SplitUp(JC1(P[i])),multiset): for j from 1 to nops(P) do for k in curr do if P[j]=k[1] then M[i,j]:=k[2]: fi: od: od: od: return M: end: ##################################################################################### # By using the built-in linalg packgage (or LinearAlgebra) find the numerical # estimate of Conway's constant, by finding the largest eigenvalue of Mat(). GetConwayConstant:=proc() local n, M, eigvals, curr, marker, i, now: n:=nops(PT()): M:=Mat(): eigvals:=LinearAlgebra[Eigenvalues](M): curr:=0: marker:=0: for i from 1 to n do now:=abs(evalf(eigvals[i])): if now>curr then curr:=now: marker:=i: fi: od: return evalf(eigvals[marker]): end: # This gives 1.30357726903430. ##################################################################################### # Using LIF(P,u,N), and exponential generatingfunctionolgy, write a procedure, # RLT1(S,N), # that inputs a set of positive integers S, and a positive integer N, # and outputs the list of size N whose i-th entry is the number of rooted labelled trees # on i vertices where each vertex either has outdegree 0 (a leaf) or an outdegree that belongs to S. # Coming up soon # Find RLT1({1},20), RLT1({1,2},20), RLT1({1,2,3},20), RLT1({1,3},20). # Are any of these in Sloane? ##################################################################################### # Using LIF(P,u,N), and exponential generatingfunctionolgy, write a procedure, # RLT2(S,N) , # that inputs a set of positive integers S, and a positive integer N, # and outputs the list of size N whose i-th entry is the number of rooted labelled trees # on i vertices where each vertex either has outdegree 0 (a leaf) or an outdegree that DOES NOT belong to S. # Coming up soon # Find RLT2({1},20), RLT2({1,2},20), RLT2({1,2,3},20), RLT2({1,3},20). # Are any of these in Sloane?