#OK to post homework =============================================================== Q1. Garvan Maple booklet (first ~30 pages): small transcript sample ------------------------------------------------------------------- # Basic exact arithmetic vs floating point > 105/25; 21/5 > evalf(105/25); 4.200000000 > evalf(Pi,30); 3.14159265358979323846264338328 # Assignment and case-sensitivity > f := 21/5: > G := -1/5: > f+g; 21/5 + g > f+G; 4 # Algebra commands: expand / factor / simplify / collect > expand((x+2)^5); x^5 + 10*x^4 + 40*x^3 + 80*x^2 + 80*x + 32 > factor(x^4-1); (x - 1) (x + 1) (x^2 + 1) > simplify((x^2-1)/(x-1)); x + 1 # Radicals > simplify(sqrt(72)); 6*sqrt(2) > radsimp(sqrt(50)+sqrt(8)); 7*sqrt(2) # Coefficients + substitution > coeff(expand((x+1)^7), x, 3); 35 > subs(x=3, (x^2+1)/(x-1)); 5 # Solving equations > solve(x^2-5*x+6=0, x); 2, 3 > solve({x+y=1, x-y=3}, {x,y}); {x = 2, y = -1} # A small loop (od) + if (fi) example > S := 0: > for i from 1 to 5 do > S := S + i^2; > od: > S; 55 > absdiff := proc(a,b) > if a>=b then > a-b; > else > b-a; > fi; > end: > absdiff(3,10); 7 Q2. Go over today's Maple code and try to understand it. - Done Q3. Do a preliminary reading of Dr. Z.'s summary of Enumeartive and Algebraic combinatorics - Done Q4. Procedure NuFP(pi) ---------------------- # NuFP(pi) = number of fixed points of permutation pi, i.e. # {i : pi[i]=i}. NuFP := proc(pi) local n, i, c; n := nops(pi); c := 0; for i from 1 to n do if pi[i] = i then c := c + 1; fi; od; return c; end: Q5. Procedure WtE(n,x) and OEIS identification ---------------------------------------------- # WtE(n,x) = sum_{pi in S_n} x^NuFP(pi). with(combinat): WtE := proc(n,x) local S, pi; if n=0 then return 1; # empty permutation, NuFP=0, so weight = x^0 = 1 fi; S := 0; for pi in permute(n) do S := S + x^NuFP(pi); od; return expand(S); end: # Example: > WtE(4,x); x^4 + 6*x^2 + 8*x + 9 # For k = 0..5, compute sequences: # [seq(coeff(WtE(i,x), x, k), i=0..8)]; # # Results (n=0..8): # # k=0: [1, 0, 1, 2, 9, 44, 265, 1854, 14833] # k=1: [0, 1, 0, 3, 8, 45, 264, 1855, 14832] # k=2: [0, 0, 1, 0, 6, 20, 135, 924, 7420] # k=3: [0, 0, 0, 1, 0, 10, 40, 315, 2464] # k=4: [0, 0, 0, 0, 1, 0, 15, 70, 630] # k=5: [0, 0, 0, 0, 0, 1, 0, 21, 112] # # OEIS A-numbers (rencontres numbers, fixed points of permutations): # k=0 -> A000166 # k=1 -> A182390 # k=2 -> A000387 # k=3 -> Not Exist (have significant overlap with A000449) # k=4 -> Not Exist (overlap with A000475) # k=5 -> Not Exist Q6. (end)