NotebookFileName[]

Below I introduce and name a 2x3 matrix.

mA=(1/5){{7,-4},{8,-1}}

To see this matrix in traditional form use

MatrixForm[mA]

Apply matrix to a vector, here a vector is just a list of two real numbers:

mA.{1,0}

mA.{0,1}

In class we calculated that the rotation below is hidden in the matrix mA:

mR=(1/5){{3,-4},{4,3}}

We also calculated that the change of coordinates matrix mP below connect the above rotation to the matrix mA

mP={{1,0},{1,1}}

Inverse[mP]

In Mathematica it is easy to verify what we calculated in class:

MatrixForm[5mP.mR.Inverse[mP]]

To illustrate the action of a 2x2 matrix it is convenient to apply powers of that matrix to a vector:

Table[MatrixPower[mR,k].{1,0},{k,0,10}]

To illustrate in a picture we use the command Point[]

Point[#]&/@Table[MatrixPower[mR,k].{1,0},{k,0,10}]

Graphics[
{
{Point[{0,0}],Point[{1,0}]},
{Point[#]&/@Table[MatrixPower[mR,k].{1,0},{k,0,100}]}
},
PlotRange-> {{-1.5,1.5},{-1.5,1.5}},
Frame->True,AspectRatio->Automatic,
GridLines->{Range[-10,10,1/10],Range[-10,10,1/10]}
]

Question from the class: Eigenvalues of a rotation:

{{Cos[θ],-Sin[θ]},{Sin[θ],Cos[θ]}}

Eigenvalues[{{Cos[θ],-Sin[θ]},{Sin[θ],Cos[θ]}}]

Together with eigenvectors:

Eigensystem[{{Cos[θ],-Sin[θ]},{Sin[θ],Cos[θ]}}]

Re[{-I,1}]

Im[{-I,1}]

Going back to our matrix mA

Graphics[
{
{Point[{0,0}],Point[{1,0}]},
{Point[#]&/@Table[MatrixPower[mA,k].{1,0},{k,0,100}]}
},
PlotRange-> {{-3.5,3.5},{-3.5,3.5}},
Frame->True,AspectRatio->Automatic,
GridLines->{Range[-10,10,1/10],Range[-10,10,1/10]}
]

Different PlotRange

Graphics[
{
{Point[{0,0}],Point[{1,0}]},
{Point[#]&/@Table[MatrixPower[mA,k].{1,0},{k,0,100}]}
},
PlotRange-> Automatic,
Frame->True,AspectRatio->Automatic,
GridLines->{Range[-10,10,1/10],Range[-10,10,1/10]}
]

MatrixForm[mA={{1,2,3,4},{5,6,7,8},{9,8,7,6}}]

MatrixForm[mB=Transpose[{{a,b},{c,d},{e,f},{g,h}}]]

?Inner

Inner[#1.#2&,mA,mB,(#1+#2)&]

?Outer

(#1.#2)&[{2,3},{a,b}]

Apply[List,{a,b,c}]

MyInner[ff_,lst1_,lst2_,gg_]:=Table[ff[lst1[[k]],lst2[[k]]],{k,1,Length[lst1]}]

MyInner[(#1.#2)&,{{1,2,3,4},{5,6,7,8},{9,8,7,6}},{{a,c,e,g},{b,d,f,h}},Plus]

Outer[(#1.#2)&,{{1,2,3,4},{5,6,7,8},{9,8,7,6}},{{a,c,e,g},{b,d,f,h}}]

MyOuter[ff_,lst1_,lst2_]:=Table[Table[ff[lst1[[j]],lst2[[k]]],{k,1,Length[lst2]}],{j,1,Length[lst1]}]

MyOuter[(#1.#2)&,{{1,2,3,4},{5,6,7,8},{9,8,7,6}},{{a,c,e,g},{b,d,f,h}}]

Array[x,{3}]

p3=Permutations[{1,2,3}]

p3[[3,1]]

pr=Expand[Product[Product[x[i]-x[j],{i,1,j-1}],{j,1,3}]]

Table[{FullSimplify[((Expand[Product[Product[x[p3[[k,i]]]-x[p3[[k,j]]],{i,1,j-1}],{j,1,3}]])/pr)],k},{k,1,Length[p3]}]

ps[[1]]

ps=Permutations[Range[3]];

Table[{FullSimplify[((Expand[Product[Product[x[ps[[k,i]]]-x[ps[[k,j]]],{i,1,j-1}],{j,2,Length[ps[[1]]]}]])/(Expand[Product[Product[x[i]-x[j],{i,1,j-1}],{j,1,Length[ps[[1]]]}]]))],ps[[k]]},{k,1,Length[ps]}]

Product[Product[x[i]-x[j],{i,1,j-1}],{j,2,Length[ps[[1]]]}]

Expand[Product[Product[x[ps[[2,i]]]-x[ps[[2,j]]],{i,1,j-1}],{j,1,Length[ps[[1]]]}]]

6!

sp=Permutations[Range[6]][[545]]

(-1)^Length[Select[Subsets[sp,{2}],#[[1]]>#[[2]]&]]

FullSimplify[((Expand[Product[Product[x[sp[[i]]]-x[sp[[j]]],{i,1,j-1}],{j,2,Length[sp]}]])/(Expand[Product[Product[x[i]-x[j],{i,1,j-1}],{j,1,Length[sp]}]]))]

Array[a,{3,3}]

MatrixForm[Table[Subscript[a, i, j], {i, 1, 3}, {j, 1, 3}]]

mT=Table[Subscript[a, i, j], {i, 1, 3}, {j, 1, 3}]

Det[mT[[{1,2},{1,2}]]]

Det[mT[[{1,2},{1,3}]]]

IdentityMatrix[3]

MatrixForm[{{1,0,0},{-(Subscript[a, 2,1]),(Subscript[a, 1,1]),0},{-(Subscript[a, 3,1]),0,(Subscript[a, 1,1])}}.{{(Subscript[a, 1,1]),(Subscript[a, 1,2]),(Subscript[a, 1,3])},{(Subscript[a, 2,1]),(Subscript[a, 2,2]),(Subscript[a, 2,3])},{(Subscript[a, 3,1]),(Subscript[a, 3,2]),(Subscript[a, 3,3])}}]

MatrixForm[{{1,0,0},{0,1,0},{0,-(-(Subscript[a, 1,2]) (Subscript[a, 3,1])+(Subscript[a, 1,1]) (Subscript[a, 3,2])),-(Subscript[a, 1,2]) (Subscript[a, 2,1])+(Subscript[a, 1,1]) (Subscript[a, 2,2])}}.{{1,0,0},{-(Subscript[a, 2,1]),(Subscript[a, 1,1]),0},{-(Subscript[a, 3,1]),0,(Subscript[a, 1,1])}}.{{(Subscript[a, 1,1]),(Subscript[a, 1,2]),(Subscript[a, 1,3])},{(Subscript[a, 2,1]),(Subscript[a, 2,2]),(Subscript[a, 2,3])},{(Subscript[a, 3,1]),(Subscript[a, 3,2]),(Subscript[a, 3,3])}}]

mat={{1,0,0},{0,1,0},{0,-(-(Subscript[a, 1,2]) (Subscript[a, 3,1])+(Subscript[a, 1,1]) (Subscript[a, 3,2])),-(Subscript[a, 1,2]) (Subscript[a, 2,1])+(Subscript[a, 1,1]) (Subscript[a, 2,2])}}.{{1,0,0},{-(Subscript[a, 2,1]),(Subscript[a, 1,1]),0},{-(Subscript[a, 3,1]),0,(Subscript[a, 1,1])}}.{{(Subscript[a, 1,1]),(Subscript[a, 1,2]),(Subscript[a, 1,3])},{(Subscript[a, 2,1]),(Subscript[a, 2,2]),(Subscript[a, 2,3])},{(Subscript[a, 3,1]),(Subscript[a, 3,2]),(Subscript[a, 3,3])}}; 

MatrixForm[ReplacePart[mat,{{3,1}->FullSimplify[mat[[3,1]]],{3,2}->Simplify[mat[[3,2]]],{3,3}->FullSimplify[mat[[3,3]]]}]]

{4,2,2,1}

vp={2.997301790043949`,-1.1817721047745011`,1.0342130688480893`};

vp

sc=3/8;Graphics3D[
{
{RGBColor[0,1,0],Opacity[0.14],
Polygon[{{-10,-10,sc 9},{10,-10,sc 9},{10,10,sc 9},{-10,10,sc 9},{-10,-10,sc 9}}]},
{RGBColor[0.5,0,0.5],Thickness[0.001],Line[sc{{5,0,0},{5,9,0},{0,9,0}}],Line[sc{{5,0,9},{5,9,9},{0,9,9},{0,0,9},{5,0,9}}],
Line[sc{{5,0,9},{5,0,0}}],Line[sc{{5,9,9},{5,9,0}}],Line[sc{{0,9,9},{0,9,0}}]},
{RGBColor[0,1,0],Opacity[0.15],
Polygon[{{0,0,0},sc{5,0,0},sc{5,0,0}+sc{5,9,0},sc{5,9,0},{0,0,0}}],Polygon[{{0,0,0},sc{5,0,0},sc{5,0,0}+sc{-5,9,9},sc{-5,9,9},{0,0,0}}],
Polygon[{{0,0,0},sc{5,9,0},sc{5,9,0}+sc{-5,9,9},sc{-5,9,9},{0,0,0}}],
Polygon[(sc{-5,9,9}+#)&/@{{0,0,0},sc{5,0,0},sc{5,0,0}+sc{5,9,0},sc{5,9,0},{0,0,0}}],
Polygon[(sc{5,9,0}+#)&/@{{0,0,0},sc{5,0,0},sc{5,0,0}+sc{-5,9,9},sc{-5,9,9},{0,0,0}}],
Polygon[(sc{5,0,0}+#)&/@{{0,0,0},sc{5,9,0},sc{5,9,0}+sc{-5,9,9},sc{-5,9,9},{0,0,0}}]},
{RGBColor[0.5,0,0.5],Thickness[0.006],Arrowheads[0.03],Arrow[{{0,0,0},#}]&/@IdentityMatrix[3]},
{RGBColor[0.5,0,0.5],Thickness[0.004],Arrowheads[0.025],Arrow[{{0,0,0},sc{0,9,0}}],Arrow[{{0,0,0},sc{0,0,9}}]},
{RGBColor[0,0.65,0],Thickness[0.006],Arrowheads[0.025],Arrow[{{0,0,0},#}]&/@(sc{{5,0,0},{5,9,0},{-5,9,9}})}
},
PlotRange->{{-2,4.2},{-0.75,7},{-0.1,3.8}},Boxed->True,Axes->True,AxesLabel->{u1,u2,u3},AxesEdge->{{-1,-1},{-1,-1},{-1,-1}},ImageSize->800,ViewPoint->Dynamic[vp]
]

sc=3/8;Graphics3D[
{
{RGBColor[0,1,0],Opacity[0.14],
Polygon[{{-10,-10,sc 9},{10,-10,sc 9},{10,10,sc 9},{-10,10,sc 9},{-10,-10,sc 9}}]},
{RGBColor[0.5,0,0.5],Thickness[0.001],Line[sc{{5,0,0},{5,9,0},{0,9,0}}],Line[sc{{5,0,9},{5,9,9},{0,9,9},{0,0,9},{5,0,9}}],
Line[sc{{5,0,9},{5,0,0}}],Line[sc{{5,9,9},{5,9,0}}],Line[sc{{0,9,9},{0,9,0}}]},
{RGBColor[0.5,0,0.5],Opacity[0.15],
Polygon[{{0,0,0},sc{5,0,0},sc{5,9,0},sc{0,9,0},{0,0,0}}],Polygon[{{0,0,0},sc{5,0,0},sc{5,0,0}+sc{-5,9,9},sc{-5,9,9},{0,0,0}}],
Polygon[(sc{0,9,0}+#)&/@{{0,0,0},sc{5,0,0},sc{5,0,0}+sc{-5,9,9},sc{-5,9,9},{0,0,0}}],
Polygon[(sc{-5,9,9}+#)&/@{{0,0,0},sc{5,0,0},sc{5,9,0},sc{0,9,0},{0,0,0}}],
Polygon[{{0,0,0},sc{0,9,0},sc{0,9,0}+sc{-5,9,9},sc{-5,9,9},{0,0,0}}], 
Polygon[(sc{5,0,0}+#)&/@{{0,0,0},sc{0,9,0},sc{0,9,0}+sc{-5,9,9},sc{-5,9,9},{0,0,0}}]},
{RGBColor[0.5,0,0.5],Thickness[0.006],Arrowheads[0.03],Arrow[{{0,0,0},#}]&/@IdentityMatrix[3]},
{RGBColor[0.5,0,0.5],Thickness[0.004],Arrowheads[0.025],Arrow[{{0,0,0},sc{0,9,0}}],Arrow[{{0,0,0},sc{0,0,9}}]},
{RGBColor[0,0.65,0],Thickness[0.006],Arrowheads[0.025],Arrow[{{0,0,0},#}]&/@(sc{{5,0,0},{5,9,0},{-5,9,9}})}
},
PlotRange->{{-2,4.2},{-0.75,7},{-0.1,3.8}},Boxed->True,Axes->True,AxesLabel->{u1,u2,u3},AxesEdge->{{-1,-1},{-1,-1},{-1,-1}},ImageSize->800,ViewPoint->{2.997301790043949`,-1.1817721047745011`,1.0342130688480893`}
]

Options[%,{ViewPoint,ViewAngle,ViewVertical,ViewCenter}]

sc=3/8;Graphics3D[
{
{RGBColor[0,1,0],Opacity[0.14],
Polygon[{{-10,-10,sc 9},{10,-10,sc 9},{10,10,sc 9},{-10,10,sc 9},{-10,-10,sc 9}}]},
{RGBColor[0.5,0,0.5],Thickness[0.001],Line[sc{{5,0,0},{5,9,0},{0,9,0}}],Line[sc{{5,0,9},{5,9,9},{0,9,9},{0,0,9},{5,0,9}}],
Line[sc{{5,0,9},{5,0,0}}],Line[sc{{5,9,9},{5,9,0}}],Line[sc{{0,9,9},{0,9,0}}]},
{RGBColor[0.5,0,0.5],Opacity[0.15],
Polygon[{{0,0,0},sc{5,0,0},sc{5,9,0},sc{0,9,0},{0,0,0}}],
Polygon[{{0,0,0},sc{5,0,0},sc{5,0,9},sc{0,0,9},{0,0,0}}],
Polygon[{{0,0,0},sc{0,9,0},sc{0,9,9},sc{0,0,9},{0,0,0}}],
Polygon[{sc{0,0,9},sc{5,0,9},sc{5,9,9},sc{0,9,9},sc{0,0,9}}],
Polygon[{sc{0,9,0},sc{5,9,0},sc{5,9,9},sc{0,9,9},sc{0,9,0}}],
Polygon[{sc{5,0,0},sc{5,9,0},sc{5,9,9},sc{5,0,9},sc{5,0,0}}]
},
{RGBColor[0.5,0,0.5],Thickness[0.006],Arrowheads[0.03],Arrow[{{0,0,0},#}]&/@IdentityMatrix[3]},
{RGBColor[0.5,0,0.5],Thickness[0.004],Arrowheads[0.025],Arrow[{{0,0,0},sc{0,9,0}}],Arrow[{{0,0,0},sc{0,0,9}}]},
{RGBColor[0,0.65,0],Thickness[0.006],Arrowheads[0.025],Arrow[{{0,0,0},#}]&/@(sc{{5,0,0},{5,9,0},{-5,9,9}})}
},
PlotRange->{{-2,4.2},{-0.75,7},{-0.1,3.8}},Boxed->True,Axes->True,AxesLabel->{u1,u2,u3},AxesEdge->{{-1,-1},{-1,-1},{-1,-1}},ImageSize->800,ViewPoint->{2.997301790043949`,-1.1817721047745011`,1.0342130688480893`}
]

MatrixForm[mM=ArrayFlatten[{{0IdentityMatrix[2],DiagonalMatrix[{2,3}]},{DiagonalMatrix[{2,3}],0IdentityMatrix[2]}}]]

Eigensystem[mM]

MatrixForm[mM=KroneckerProduct[Reverse[IdentityMatrix[3]],DiagonalMatrix[{-1,2,3}]]]

Eigensystem[mM]

Eigensystem[{{1,2,3},{4,5,6},{7,8,9}}]

MatrixForm[{{2,1,3},{3,1,2},{1,2,3}}]

Eigensystem[{{2,1,3},{3,1,2},{1,2,3}}]

Inverse[Transpose[{{1,1,1},{-7,-16,13},{9,-11 ,0}}]].{{2,1,3},{3,1,2},{1,2,3}}.Transpose[{{1,1,1},{-7,-16,13},{9,-11 ,0}}]

Eigensystem[{{3,3,1},{3,1,1},{5,5,5}}]

TeXForm[{{3,3,1},{3,1,1},5{1,1,1}}]

Eigensystem[{{3,3,1},{3,1,1},5{1,1,1}}]

IdentityMatrix[3]

MatrixForm[{{1,1,1},{2,3,0},{-1,-1,0}}]

MatrixForm[{{1,-1,0},{0,1,0},{0,0,1}}.{{1,0,-1},{0,1,0},{0,0,1}}.{{1,0,0},{0,1,2},{0,0,1}}.{{1,0,0},{0,1,0},{1,0,1}}.{{1,0,0},{-2,1,0},{0,0,1}}.{{1,1,1},{2,3,0},{-1,-1,0}}]

MatrixForm[{{1,-1,0},{0,1,0},{0,0,1}}.{{1,0,-1},{0,1,0},{0,0,1}}.{{1,0,0},{0,1,2},{0,0,1}}.{{1,0,0},{0,1,0},{1,0,1}}.{{1,0,0},{-2,1,0},{0,0,1}}]

MatrixForm[{{1,0,-2},{0,1,0},{0,0,1}}.{{1,0,0},{0,1,2},{0,0,1}}.{{1,0,0},{-2,1,0},{0,0,1}}]

MatrixForm[{{1,2,0},{0,1,0},{0,0,1}}.{{1,0,0},{0,1,2},{0,0,1}}.{{1,0,0},{0,1,0},{1,0,1}}]

MatrixForm[Inverse[{{1,2,0},{0,1,0},{0,0,1}}.{{1,0,0},{0,1,2},{0,0,1}}.{{1,0,0},{0,1,0},{1,0,1}}]]

Inverse[{{1,2,0},{0,1,0},{0,0,1}}.{{1,0,0},{0,1,2},{0,0,1}}.{{1,0,0},{0,1,0},{1,0,1}}]

{{1,2,0},{0,1,0},{0,0,1}}.{{1,0,0},{0,1,2},{0,0,1}}.{{1,0,0},{0,1,0},{1,0,1}}

MatrixForm[{{1,0,1},{0,1,0},{0,0,-1}}.{{1,0,0},{0,1,0},{0,-2,1}}.{{1,0,0},{0,1,0},{-5,0,1}}.{{1,0,0},{-2,1,0},{0,0,1}}.{{0,0,1},{0,1,0},{1,0,0}}.{{5,2,4},{2,1,2},{1,0,1}}]

MatrixForm[{{1,2,0},{0,1,0},{0,0,1}}.{{1,0,0},{0,1,2},{0,0,1}}.{{1,0,0},{0,1,0},{1,0,1}}.{{1,-2,0},{0,1,-2},{-1,2,1}}]

IdentityMatrix[4]

MatrixForm[mM={{1,0,0,0},{1,1,0,0},{1,1,1,0},{1,1,1,1}}.{{1,1,1,1},{0,1,1,1},{0,0,1,1},{0,0,0,1}}]

Inverse[mM]

MatrixForm[mM.DiagonalMatrix[{2,-1,-1,1}].Inverse[mM]]

mM

mO=1/2{{-1,-1,1,1},{-1,1,-1,1},{1,-1,-1,1},{1,1,1,1}}

Inverse[mO]

MatrixForm[mO.DiagonalMatrix[{1/2,-4,4,4}].Inverse[mO]]

MatrixForm[mM3={{1,0,0},{1,-1,0},{-2,1,1}}.{{-1,1,-1},{0,1,-2},{0,0,1}}]

MatrixForm[mA=mM3.DiagonalMatrix[{2,-1,-4}].Inverse[mM3]]

mA.{-1,1,1}