It is ok to post! # Name:Treasa Bency Biju Jose # Date: 10-06-2020 # Assignment #10 ------------------------------------------------------------------------------------------------------------- 1. By MAPLE: P1 := randperm(9); P1 := [1, 9, 6, 2, 7, 3, 8, 4, 5] P2 := randperm(9); P2 := [2, 1, 4, 9, 8, 6, 7, 3, 5] MulPers(P1, P2); [2, 5, 6, 1, 7, 4, 3, 9, 8] MulPers(P2, P1); [9, 1, 2, 5, 4, 3, 8, 6, 7] (ii) By MAPLE: P := randperm(9); P := [4, 5, 8, 2, 1, 3, 6, 9, 7] InvPer(P); [5, 4, 6, 1, 2, 7, 9, 3, 8] (iii) By hand: [1, 2, 3, 4, 5, 6, 7, 8, 9] [5, 6, 1, 9, 4, 8, 2, 3, 7] PtoC(P) by hand: [1, 5, 4, 9, 7, 2, 6, 8, 3] By MAPLE: P := randperm(9); P := [5, 6, 1, 9, 4, 8, 2, 3, 7] PtoC(P); [[9, 7, 2, 6, 8, 3, 1, 5, 4]] (iv) By hand: inv(P) by hand: 15 maj(P) by hand: 9 By MAPLE: P := randperm(9); P := [9, 4, 5, 1, 3, 2, 6, 7, 8] inv(P); 15 maj(P); 9 ------------------------------------------------------------------------------------------------------------- 2. with(combinat); InvGF := proc(n, q) local i, B, A; A := 0; B := permute(n); for i to nops(B) do A := A + q^inv(B[i]); end do; factor(A); end proc; with(combinat); MajGF := proc(n, q) local i, B, A; A := 0; B := permute(n); for i to nops(B) do A := A + q^maj(B[i]); end do; factor(A); end proc; Y := proc(k) local n; for n to 7 do evalb(InvGF(n, k) = MajGF(n, k)); end do; end proc; Y(2); true ------------------------------------------------------------------------------------------------------------- 3. InvGF(2, 5)/InvGF(1, 5); 6 InvGF(3, 5)/InvGF(2, 5); 31 InvGF(4, 5)/InvGF(3, 5); 156 InvGF(5, 5)/InvGF(4, 5); 781 InvGF(6, 5)/InvGF(5, 5); 3906 InvGF(7, 5)/InvGF(6, 5); 19531 with(gfun); factor(guessgf([6, 31, 156, 781, 3906, 19531], x)); [-(5*x - 6)/((5*x - 1)*(x - 1)), ogf] -------------------------------------------------------------------------------------------------------------