(*tut 1A, Q5*)
invA={{1,3,0},{0,1,1},{1,-1,4}};
invB={{2,1,1},{0,0,-2},{1,1,-1}};
Print["(AB)^{-1} = inv[B].inv[A]= ",invB.invA//MatrixForm];

(*tut 1A, Q7*)
A={{-1,-1,-1},{0,1,0},{0,0,1}};
Print["A=",A//MatrixForm];
Print["A^2=",A.A//MatrixForm];
Print["A^3=",A.A.A//MatrixForm];
Print["A^3=A, hence A has period of 2"];

B={{0,1,0},{0,0,1},{-1,-1,-1}};
Print["B=",B//MatrixForm];
Print["B^2=",B.B//MatrixForm];
Print["B^3=",B.B.B//MatrixForm];
Print["B^4=",B.B.B.B//MatrixForm];
Print["B^5=",B.B.B.B.B//MatrixForm];
Print["B^5=B, hence B has period of 4"];

c={{0,1,0},{-1,-1,-1},{0,0,1}};
Print["C=",c//MatrixForm];
Print["C^2=",c.c//MatrixForm];
Print["C^3=",c.c.c//MatrixForm];
Print["C^4=",c.c.c.c//MatrixForm];
Print["C^4=C, hence C has period of 3"];