(************** Content-type: application/mathematica ************** CreatedBy='Mathematica 5.2' Mathematica-Compatible Notebook This notebook can be used with any Mathematica-compatible application, such as Mathematica, MathReader or Publicon. The data for the notebook starts with the line containing stars above. To get the notebook into a Mathematica-compatible application, do one of the following: * Save the data starting with the line of stars above into a file with a name ending in .nb, then open the file inside the application; * Copy the data starting with the line of stars above to the clipboard, then use the Paste menu command inside the application. Data for notebooks contains only printable 7-bit ASCII and can be sent directly in email or through ftp in text mode. Newlines can be CR, LF or CRLF (Unix, Macintosh or MS-DOS style). NOTE: If you modify the data for this notebook not in a Mathematica- compatible application, you must delete the line below containing the word CacheID, otherwise Mathematica-compatible applications may try to use invalid cache data. For more information on notebooks and Mathematica-compatible applications, contact Wolfram Research: web: http://www.wolfram.com email: info@wolfram.com phone: +1-217-398-0700 (U.S.) Notebook reader applications are available free of charge from Wolfram Research. *******************************************************************) (*CacheID: 232*) (*NotebookFileLineBreakTest NotebookFileLineBreakTest*) (*NotebookOptionsPosition[ 47118, 1886]*) (*NotebookOutlinePosition[ 48046, 1917]*) (* CellTagsIndexPosition[ 48002, 1913]*) (*WindowFrame->Normal*) Notebook[{ Cell[CellGroupData[{ Cell["Matrices", "Title", Evaluatable->False, TextAlignment->Center, AspectRatioFixed->True], Cell[TextData[{ "Sean Mauch\nsean@caltech.edu\n", ButtonBox["http://www.its.caltech.edu/~sean", ButtonData:>{ URL[ "http://www.its.caltech.edu/~sean"], None}, ButtonStyle->"Hyperlink"], "\n", "This work is distributed under the GNU FDL. See ", ButtonBox["license.nb ", ButtonData:>{"license.nb", None}, ButtonStyle->"Hyperlink"], "for details." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell["Constructing Vectors", "Section", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "In ", StyleBox["Mathematica", FontSlant->"Italic"], " vectors are represented as lists." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[BoxData[ \(vec1 = {1, 2, 3, 4}\)], "Input", AspectRatioFixed->True], Cell[TextData[{ "The ", StyleBox["MatrixForm[]", "Input"], " function will format a vector into a vertical column." }], "Text", Evaluatable->False, TextJustification->1, AspectRatioFixed->True], Cell[BoxData[ \(MatrixForm[vec1]\)], "Input", AspectRatioFixed->True], Cell["You can use the table function to create vectors.", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[BoxData[ \(Table[1, {i, 6}]\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(Table[Sin[i], {i, 5}]\)], "Input", AspectRatioFixed->True] }, Closed]], Cell[CellGroupData[{ Cell["Pieces of Vectors", "Section", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "You can refer to elements of a vector with the ", StyleBox["Part[]", FontWeight->"Bold"], " function or with subscripting, ", StyleBox["[[]]", "Input"], "." }], "Text", Evaluatable->False, TextJustification->1, AspectRatioFixed->True], Cell[BoxData[ \(\(vec2 = {2, 4, 6, 8}; \)\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(vec2\[LeftDoubleBracket]2\[RightDoubleBracket]\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(vec2\[LeftDoubleBracket]{1, 3}\[RightDoubleBracket]\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(vec2\[LeftDoubleBracket]2\[RightDoubleBracket]\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(vec2\[LeftDoubleBracket]{1, 3}\[RightDoubleBracket]\)], "Input", AspectRatioFixed->True], Cell["\<\ Since vectors are lists, you can use any of the list functions on \ vectors.\ \>", "Text", Evaluatable->False, TextJustification->1, AspectRatioFixed->True], Cell[BoxData[ \(Take[vec2, 3]\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(Length[vec2]\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(Rest[vec2]\)], "Input", AspectRatioFixed->True], Cell["You can assign new values to elements of vectors.", "Text", Evaluatable->False, TextJustification->1, AspectRatioFixed->True], Cell[BoxData[ \(vec2\[LeftDoubleBracket]1\[RightDoubleBracket] = 10; vec2\)], "Input", AspectRatioFixed->True] }, Closed]], Cell[CellGroupData[{ Cell["Operations on Vectors", "Section", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell["Arithmetic", "Subsection", Evaluatable->False, AspectRatioFixed->True], Cell["\<\ When you apply a function to a vector, the result is a vector of \ the function acting on the elements.\ \>", "Text", Evaluatable->False, TextJustification->1, AspectRatioFixed->True], Cell[BoxData[ \(Sin[vec1]\)], "Input", AspectRatioFixed->True], Cell["\<\ When doing arithmetic operations on the vector and a scalar, the \ arithmetic is done componentwise.\ \>", "Text", Evaluatable->False, TextJustification->1, AspectRatioFixed->True], Cell[BoxData[ \(vec1\^2\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(vec1\ 3\)], "Input", AspectRatioFixed->True], Cell["\<\ When doing arithmetic on two vectors, the arithmetic operation is \ also done componentwise.\ \>", "Text", Evaluatable->False, TextJustification->1, AspectRatioFixed->True], Cell[BoxData[ \(vec1\ vec1\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(vec1\^vec1\)], "Input", AspectRatioFixed->True] }, Closed]], Cell[CellGroupData[{ Cell["The Dot Product", "Subsection", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "The dot product, (also called the inner product or scalar product), of two \ vectors is defined as the sum of the products of the components. In ", StyleBox["Mathematica", FontSlant->"Italic"], ", the dot product is denoted by a period." }], "Text", Evaluatable->False, TextJustification->1, AspectRatioFixed->True], Cell[BoxData[ \({a, b, c} . {x, y, z}\)], "Input", AspectRatioFixed->True], Cell[TextData[ "You can get the typset form of the inner product by typing \"\[EscapeKey].\ \[EscapeKey]\". This makes a centered dot."], "Text", TextJustification->1], Cell[BoxData[ \(vec1\[CenterDot]{1, 1, 1, 1}\)], "Input", AspectRatioFixed->True], Cell[TextData[{ "The length of a vector is the square root of the dot product of the vector \ with itself. Thus the length of ", StyleBox["vec1", "Input"], " is" }], "Text", Evaluatable->False, TextJustification->1, AspectRatioFixed->True], Cell[BoxData[ \(\@\(vec1 . vec1\)\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(Clear[vec1, vec2]\)], "Input", AspectRatioFixed->True], Cell["\<\ The dot product of two vectors is equal to the product of the \ lengths of the vectors times the cosine of the angle between them.\ \>", "Text", Evaluatable->False, TextJustification->1, AspectRatioFixed->True], Cell[BoxData[ \({1, 0} . {1, 1}\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(\@\({1, 0} . {1, 0}\)\ \@\({1, 1} . {1, 1}\)\ Cos[\[Pi]\/4]\)], "Input",\ AspectRatioFixed->True] }, Closed]], Cell[CellGroupData[{ Cell["The Cross Product", "Subsection", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "If you load the ", StyleBox["VectorAnalysis", "Input"], " package, you can take the cross product, (also called the vector \ product), of two vectors." }], "Text", Evaluatable->False, TextJustification->1, AspectRatioFixed->True], Cell[BoxData[ \(<< Calculus`VectorAnalysis`\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(CrossProduct[{1, 2, 3}, {1, 1, 1}]\)], "Input", AspectRatioFixed->True], Cell["You can see the formula for the cross product below.", "Text", Evaluatable->False, TextJustification->1, AspectRatioFixed->True], Cell[BoxData[ \(cross = CrossProduct[{a, b, c}, {x, y, z}]\)], "Input", AspectRatioFixed->True], Cell["\<\ The cross product of two vectors is orthogonal to the original two \ vectors.\ \>", "Text", Evaluatable->False, TextJustification->1, AspectRatioFixed->True], Cell[BoxData[ \(Simplify[{a, b, c} . cross]\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(Simplify[{x, y, z} . cross]\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(Clear[cross]\)], "Input", AspectRatioFixed->True], Cell["\<\ The length of the cross product vector is the product of the \ lengths of the two original vectors times the sine of the angle between the \ two vectors. Thus the cross product of two parallel vectors is the zero \ vector.\ \>", "Text", Evaluatable->False, TextJustification->1, AspectRatioFixed->True], Cell[BoxData[ \(CrossProduct[{1, 2, 3}, {2, 4, 6}]\)], "Input", AspectRatioFixed->True], Cell["\<\ If two vectors are orthogonal, then the length of the cross product \ vector is the product of the length of the two argument vectors. Here are \ two orthogonal vectors:\ \>", "Text", Evaluatable->False, TextJustification->1, AspectRatioFixed->True], Cell[BoxData[{ \(a = {1, 2, 3}; b = {1, 1, \(-1\)}; \), \(a . b\)}], "Input", AspectRatioFixed->True], Cell[BoxData[ \(c = CrossProduct[a, b]\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(\@\(c . c\) == \@\(a . a\)\ \@\(b . b\)\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(Clear[a, b, c]\)], "Input", AspectRatioFixed->True], Cell[CellGroupData[{ Cell["Exercise 1", "Subsubsection"], Cell[TextData[{ "Find the angle between the two vectors, ", Cell[BoxData[ \(TraditionalForm\`{1, \ 2, \ 3}\)]], " and ", Cell[BoxData[ \(TraditionalForm\`{3, \ 2, \ 1}\)]], ", first using the dot product and then using the cross product." }], "Text", TextJustification->1] }, Open ]] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["Constructing Matrices", "Section", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "In ", StyleBox["Mathematica", FontSlant->"Italic"], ", a matrix is represented as a list of lists. The sublists are the rows \ of the matrix." }], "Text", Evaluatable->False, TextJustification->1, AspectRatioFixed->True], Cell[BoxData[ \(m = {{1, 2}, {3, 4}}\)], "Input", AspectRatioFixed->True], Cell[TextData[{ "You can format a matrix output so it is easier to read with the ", StyleBox["MatrixForm[]", "Input"], " function." }], "Text", Evaluatable->False, TextJustification->1, AspectRatioFixed->True], Cell[BoxData[ \(MatrixForm[m]\)], "Input", AspectRatioFixed->True], Cell[TextData[{ "It is most common to use the ", StyleBox["MatrixForm[]", "Input"], " function in postfix form." }], "Text", Evaluatable->False, TextJustification->1, AspectRatioFixed->True], Cell[BoxData[ \(m // MatrixForm\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(Clear[m]\)], "Input", AspectRatioFixed->True], Cell[TextData[{ "To input a typeset matrix, click on the ", Cell[BoxData[ FormBox[ RowBox[{"(", GridBox[{ {"\[Square]", "\[Square]"}, {"\[Square]", "\[Square]"} }], ")"}], TraditionalForm]]], " button on the BasicInput palette. You can use the \[TabKey] to move to \ the next PlaceHolder, or you can click in the PlaceHolder boxes to move to \ different entries in the matrix. You can add a row by pressing \[ControlKey]\ \[LeftModified]\[ReturnKey]\[RightModified]; add a new column with \ \[ControlKey]\[LeftModified],\[RightModified]; press \[ControlKey]\ \[LeftModified]\[SpaceKey]\[RightModified] to move the cursor to the right of \ the matrix. Below enter the matrices ", Cell[BoxData[ FormBox[ RowBox[{"(", GridBox[{ {"1", "2"}, {"3", "4"} }], ")"}], TraditionalForm]]], " and then ", Cell[BoxData[ FormBox[ RowBox[{"(", GridBox[{ {"a", "b", "c", "d"}, {"1", "2", "3", "4"}, {"\[Alpha]", "\[Beta]", "\[Gamma]", "\[Delta]"} }], ")"}], TraditionalForm]]], ". Note that the ", StyleBox["Mathematica", FontSlant->"Italic"], " output will be a list of lists." }], "Text", TextAlignment->Left, TextJustification->1], Cell[TextData[{ "You can use the ", StyleBox["Table[]", "Input"], " function to generate a matrix. The input\n\t", StyleBox["Table[f,{i,m},{j,n}]", "Input"], "\ngenerates a matrix with ", Cell[BoxData[ \(TraditionalForm\`m\)]], " rows and ", Cell[BoxData[ \(TraditionalForm\`n\)]], " columns. Here ", Cell[BoxData[ \(TraditionalForm\`f\)]], " is a constant symbolic expression. Each element in the list has the \ value of ", Cell[BoxData[ \(TraditionalForm\`f\)]], " evaluated at ", Cell[BoxData[ \(TraditionalForm\`i\)]], ", ", Cell[BoxData[ \(TraditionalForm\`j\)]], "." }], "Text", Evaluatable->False, TextAlignment->Left, TextJustification->1, AspectRatioFixed->True], Cell[BoxData[ \(Table[i + j, {i, 3}, {j, 5}] // MatrixForm\)], "Input", AspectRatioFixed->True], Cell[TextData[{ "You can make the zero matrix by choosing ", Cell[BoxData[ \(TraditionalForm\`f\ \[Congruent] \ 0\)]], "." }], "Text", Evaluatable->False, TextJustification->1, AspectRatioFixed->True], Cell[BoxData[ \(Table[0, {i, 3}, {j, 5}] // MatrixForm\)], "Input", AspectRatioFixed->True], Cell[TextData[{ "The ", StyleBox["Array[]", "Input"], " function has different syntax.\n\t", StyleBox["Array[f,{m,n}]", "Input"], "\ngenerates a matrix with ", Cell[BoxData[ \(TraditionalForm\`m\)]], " rows and ", Cell[BoxData[ \(TraditionalForm\`n\)]], " columns. Here ", Cell[BoxData[ \(TraditionalForm\`f\)]], " is a function of two variables. Each element in the list has the value ", StyleBox["f[i,j]", "Input"], "." }], "Text", Evaluatable->False, TextAlignment->Left, TextJustification->1, AspectRatioFixed->True], Cell[BoxData[ \(f[x_, y_] := x + y; \nArray[f, {3, 5}] // MatrixForm\)], "Input", AspectRatioFixed->True], Cell[TextData[{ "You can make a general matrix by using an undefined function as the first \ argument of ", StyleBox["Array[]", "Input"], "." }], "Text", Evaluatable->False, TextAlignment->Left, TextJustification->1, AspectRatioFixed->True], Cell[BoxData[{ \(\(m = Array[a, {2, 4}]; \)\), \(MatrixForm[m]\)}], "Input", AspectRatioFixed->True], Cell["Then you can assign values to the elements.", "Text", Evaluatable->False, TextJustification->1, AspectRatioFixed->True], Cell[BoxData[{ \(\(a[1, 1] = 1; \)\), \(MatrixForm[m]\)}], "Input", AspectRatioFixed->True], Cell[BoxData[ \(Clear[m, a]\)], "Input", AspectRatioFixed->True], Cell[TextData[{ "You can make a diagonal matrix with\n\t", StyleBox["DiagonalMatrix[dlist]", "Input"], "\nwhere dlist is a list of the elements on the diagonal." }], "Text", Evaluatable->False, TextAlignment->Left, TextJustification->1, AspectRatioFixed->True], Cell[BoxData[ \(DiagonalMatrix[{1, 2, 3, 4}] // MatrixForm\)], "Input", AspectRatioFixed->True], Cell[TextData[{ StyleBox["IdentityMatrix[n]", "Input"], " is the identity matrix of size ", Cell[BoxData[ \(TraditionalForm\`n\)]], "." }], "Text", Evaluatable->False, TextAlignment->Left, TextJustification->1, AspectRatioFixed->True], Cell[BoxData[ \(IdentityMatrix[5] // MatrixForm\)], "Input", AspectRatioFixed->True], Cell[CellGroupData[{ Cell["Exercise 2", "Subsubsection"], Cell["\<\ Make a 7 by 5 matrix of random integers between 0 and 9 \ inclusive.\ \>", "Text", TextJustification->1] }, Open ]], Cell[CellGroupData[{ Cell["Exercise 3", "Subsubsection"], Cell[TextData[{ "Make a 3 by 4 matrix where the ", Cell[BoxData[ \(TraditionalForm\`\((i, j)\)\^th\)]], " element has the value ", Cell[BoxData[ \(TraditionalForm\`x\^i\ y\^j\)]], ". Do this once using ", Cell[BoxData[ \(TraditionalForm\`Table[]\)]], " and once using ", Cell[BoxData[ \(TraditionalForm\`Array[]\)]], "." }], "Text", TextJustification->1] }, Open ]] }, Closed]], Cell[CellGroupData[{ Cell["Manipulating Pieces of Matrices", "Section", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell["Referring to Pieces of Matrices", "Subsection", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "You can refer to elements of a matrix with the ", StyleBox["Part[]", "Input"], " function or with subscripting, ", StyleBox["[[]]", "Input"], "." }], "Text", Evaluatable->False, TextJustification->1, AspectRatioFixed->True], Cell[BoxData[{ \(\(m = Table[i - j, {i, 4}, {j, 3}]; \)\), \(MatrixForm[m]\)}], "Input", AspectRatioFixed->True], Cell["\<\ Since a matrix is represented as a list of rows, the first number \ refers to the row, the second number refers to the column.\ \>", "Text", Evaluatable->False, TextJustification->1, AspectRatioFixed->True], Cell[BoxData[ \(m\[LeftDoubleBracket]1, 3\[RightDoubleBracket]\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(m\[LeftDoubleBracket]1, 3\[RightDoubleBracket]\)], "Input", AspectRatioFixed->True], Cell[BoxData[{ \(\(m\[LeftDoubleBracket]4, 1\[RightDoubleBracket] = 5; \)\), \(MatrixForm[m]\)}], "Input", AspectRatioFixed->True], Cell[TextData[{ "To refer to a row in the matrix give only one argument to ", StyleBox["Part[]", "Input"], " or ", StyleBox["[[]]", "Input"], "." }], "Text", Evaluatable->False, TextJustification->1, AspectRatioFixed->True], Cell[BoxData[ \(m\[LeftDoubleBracket]1\[RightDoubleBracket]\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(m\[LeftDoubleBracket]2\[RightDoubleBracket]\)], "Input", AspectRatioFixed->True], Cell[TextData[{ "The ", StyleBox["Transpose[]", "Input"], " function returns a matrix in which the rows are the columns of the \ argument." }], "Text", Evaluatable->False, TextJustification->1, AspectRatioFixed->True], Cell[BoxData[ \(Transpose[m] // MatrixForm\)], "Input", AspectRatioFixed->True], Cell[TextData[{ "Using the ", StyleBox["Transpose[]", "Input"], " function you can refer to a column in a matrix. Here is the second \ column of m." }], "Text", Evaluatable->False, TextJustification->1, AspectRatioFixed->True], Cell[BoxData[ \(\(Transpose[m]\)\[LeftDoubleBracket]2\[RightDoubleBracket]\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(MatrixForm[m]\)], "Input"], Cell[TextData[{ "You can get a submatrix with indexing. Below is a submatrix of ", Cell[BoxData[ \(TraditionalForm\`m\)]], " composed of the elements in the first and third rows and the first and \ second columns." }], "Text", TextJustification->1], Cell[BoxData[ \(m[\([{1, 3}, {1, 2}]\)] // MatrixForm\)], "Input"], Cell[TextData[{ "You can use the ", StyleBox["Range[]", "Input"], " function to simplify the task of specifying the list of indices." }], "Text", TextJustification->1], Cell[BoxData[ \(Range[2, 6]\)], "Input"], Cell["\<\ Here is the submatrix composed of the elements in the first three \ rows and columns.\ \>", "Text", TextJustification->1], Cell[BoxData[ \(m[\([Range[1, 3], Range[1, 3]]\)] // MatrixForm\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Application: The Gauss-Jordan Elimination Algorithm", "Subsection", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "Consider the linear system of equations:\n\t", Cell[BoxData[ \(TraditionalForm\`x\ + \ y\ + \ z = 2\)]], "\n\t", Cell[BoxData[ \(TraditionalForm\`x\ + \ 2\ y\ + \ 3\ z = 5\)]], "\n\t", Cell[BoxData[ \(TraditionalForm\`x\ - \ 3\ y\ + \ 2\ z = 7\)]], ".\nWith the Gauss-Jordan elimination algorithm you multiply rows by \ constants, add multiples of one row to another and swap rows to produce a \ system of equations of the form:\n\t", Cell[BoxData[ \(TraditionalForm\`x = a\)]], "\n\t", Cell[BoxData[ \(TraditionalForm\`y = b\)]], "\n\t", Cell[BoxData[ \(TraditionalForm\`z = c\)]], "." }], "Text", Evaluatable->False, TextJustification->1, AspectRatioFixed->True], Cell[TextData[{ "Define an adjoint matrix, ", Cell[BoxData[ \(TraditionalForm\`m\)]], ", whose first three columns are the coefficients of ", Cell[BoxData[ \(TraditionalForm\`x\)]], ", ", Cell[BoxData[ \(TraditionalForm\`y\)]], " and ", Cell[BoxData[ \(TraditionalForm\`z\)]], " in the above system of equations and whose last column is the \ right-hand-side." }], "Text", Evaluatable->False, TextJustification->1, AspectRatioFixed->True], Cell[BoxData[{ \(\(m = {{1, 1, 1, 2}, {1, 2, 3, 5}, {1, \(-3\), 2, 7}}; \)\), \(MatrixForm[m]\)}], "Input", AspectRatioFixed->True], Cell[TextData[{ "Now we do row operations to reduce ", Cell[BoxData[ \(TraditionalForm\`m\)]], " to Gauss-Jordan form. First we subtract the first row form the second \ and third rows." }], "Text", Evaluatable->False, TextJustification->1, AspectRatioFixed->True], Cell[BoxData[{ \(\(m\[LeftDoubleBracket]2\[RightDoubleBracket] -= m\[LeftDoubleBracket]1\[RightDoubleBracket]; \)\), \(\(m\[LeftDoubleBracket]3\[RightDoubleBracket] -= m\[LeftDoubleBracket]1\[RightDoubleBracket]; \)\), \(MatrixForm[m]\)}], "Input", AspectRatioFixed->True], Cell["We then subtract the second row from the third.", "Text", Evaluatable->False, TextJustification->1, AspectRatioFixed->True], Cell[BoxData[{ \(\(m\[LeftDoubleBracket]3\[RightDoubleBracket] -= \(-4\)\ m\[LeftDoubleBracket]2\[RightDoubleBracket]; \)\), \(MatrixForm[m]\)}], "Input", AspectRatioFixed->True], Cell["\<\ Now we divide the third row by 9 and subtract multiples of it from \ the second and first rows.\ \>", "Text", Evaluatable->False, TextJustification->1, AspectRatioFixed->True], Cell[BoxData[{ \(\(m\[LeftDoubleBracket]3\[RightDoubleBracket] /= 9; \)\), \(\(m\[LeftDoubleBracket]2\[RightDoubleBracket] -= 2\ m\[LeftDoubleBracket]3\[RightDoubleBracket]; \)\), \(\(m\[LeftDoubleBracket]1\[RightDoubleBracket] -= m\[LeftDoubleBracket]3\[RightDoubleBracket]; \)\), \(MatrixForm[m]\)}], "Input", AspectRatioFixed->True], Cell["\<\ Finally we subtract the second row from the first to obtain the \ Gauss-Jordan form.\ \>", "Text", Evaluatable->False, TextJustification->1, AspectRatioFixed->True], Cell[BoxData[{ \(\(m\[LeftDoubleBracket]1\[RightDoubleBracket] -= m\[LeftDoubleBracket]2\[RightDoubleBracket]; \)\), \(MatrixForm[m]\)}], "Input", AspectRatioFixed->True], Cell[TextData[{ "Thus we see that the solution to the system of equations is\n\t", Cell[BoxData[ \(TraditionalForm\`x = 8/9\)]], "\n\t", Cell[BoxData[ \(TraditionalForm\`y = \(-7\)/9\)]], "\n\t", Cell[BoxData[ \(TraditionalForm\`z = 17/9\)]], "." }], "Text", Evaluatable->False, TextJustification->1, AspectRatioFixed->True], Cell[TextData[{ "The ", StyleBox["RowReduce[]", "Input"], " function performs the Gauss-Jordan elimination algorithm." }], "Text", Evaluatable->False, TextJustification->1, AspectRatioFixed->True], Cell[BoxData[{ \(\(m = {{1, 1, 1, 2}, {1, 2, 3, 5}, {1, \(-3\), 2, 7}}; \)\), \(MatrixForm[m]\)}], "Input", AspectRatioFixed->True], Cell[BoxData[ \(RowReduce[m] // MatrixForm\)], "Input", AspectRatioFixed->True], Cell[CellGroupData[{ Cell["Exercise 4", "Subsubsection"], Cell[TextData[{ "Find the solution to the system of equations:\n\t", Cell[BoxData[ \(TraditionalForm\`w + x + y + z = 1\)]], "\n\t", Cell[BoxData[ \(TraditionalForm\`w + 2 x + 3 y + 4 z = 5\)]], "\n\t", Cell[BoxData[ \(TraditionalForm\`2 w + 3 x + 5 y + 7 z = 11\)]], "\n\t", Cell[BoxData[ \(TraditionalForm\`w + x + 2 y + 3 z = 5\)]], "\nwith the RowReduce[] function. (The adjoined matrix is entered for you \ below.)" }], "Text", TextJustification->1], Cell[BoxData[{ \(\(m = {{1, 1, 1, 1, 1}, {1, 2, 3, 4, 5}, {2, 3, 5, 7, 11}, {1, \(-1\), 1, \(-1\), 1}}; \)\), \(MatrixForm[m]\)}], "Input", AspectRatioFixed->True] }, Open ]], Cell[CellGroupData[{ Cell["Exercise 5", "Subsubsection"], Cell[TextData[{ "Apply the RowReduce[] function to the matrix associated with the following \ two linear systems.\n\t", Cell[BoxData[ \(TraditionalForm\`x + y + z = 1\)]], "\n\t", Cell[BoxData[ \(TraditionalForm\`x + 2 y + 3 z = 2\)]], "\n\t", Cell[BoxData[ \(TraditionalForm\`3 x + 2 y + z = 2\)]], "\n\t\n\t", Cell[BoxData[ \(TraditionalForm\`x + y + z = 1\)]], "\n\t", Cell[BoxData[ \(TraditionalForm\`x + 2 y + 3 z = 2\)]], "\n\t", Cell[BoxData[ \(TraditionalForm\`3 x + 2 y + z = 4\)]], "\n\t\nDo the linear systems have solutions? Are the solutions unique? \ (The adjoined matrices are entered below.)" }], "Text", TextJustification->1], Cell[BoxData[{ \(\(m1 = {{1, 1, 1, 1}, {1, 2, 3, 2}, {3, 2, 1, 2}}; \)\), \(\(m2 = {{1, 1, 1, 1}, {1, 2, 3, 2}, {3, 2, 1, 4}}; \)\)}], "Input", AspectRatioFixed->True] }, Open ]] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["Multiplying Matrices and Vectors", "Section", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell["Matrix-Vector Multiplication", "Subsection", Evaluatable->False, AspectRatioFixed->True], Cell[BoxData[{ \(\(m = {{a, b}, {c, d}}; \)\), \(MatrixForm[m]\)}], "Input", AspectRatioFixed->True], Cell[BoxData[{ \(\(v = {x, y}; \)\), \(MatrixForm[v]\)}], "Input", AspectRatioFixed->True], Cell["\<\ The result of taking the dot product of a matrix and a vector is a \ vector. The elements of this product vector are the dot products of the rows \ of the matrix with the original vector. Thus in order to take the dot \ product, the length of the rows in the matrix must be the same as the length \ of the vector.\ \>", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[BoxData[ \(MatrixForm[m . v]\)], "Input", AspectRatioFixed->True], Cell[TextData[{ "A system of linear equations can be represented by a matrix equation. \ Consider the system:\n\t", Cell[BoxData[ \(TraditionalForm\`a\ x + b\ y = e\)]], "\n\t", Cell[BoxData[ \(TraditionalForm\`c\ x + d\ y = f\)]], ".\nAfter defining the right-side vector, we can represent this system of \ equations as a matrix equation." }], "Text", Evaluatable->False, TextJustification->1, AspectRatioFixed->True], Cell[BoxData[{ \(\(w = {e, f}; \)\), \(m . v == w\)}], "Input", AspectRatioFixed->True], Cell[TextData[{ "We could use the ", StyleBox["Solve[]", "Input"], " function to solve this system." }], "Text", Evaluatable->False, TextJustification->1, AspectRatioFixed->True], Cell[BoxData[ \(Solve[m . v == w, v]\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(Clear[m, v, w]\)], "Input", AspectRatioFixed->True] }, Closed]], Cell[CellGroupData[{ Cell["Matrix-Matrix Multiplication", "Subsection", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "The result of taking the dot product, (matrix multiplication), of two \ matrices, ", Cell[BoxData[ \(TraditionalForm\`a\)]], " and ", Cell[BoxData[ \(TraditionalForm\`b\)]], ", is another matrix, ", Cell[BoxData[ \(TraditionalForm\`c\)]], ". The ", Cell[BoxData[ \(TraditionalForm\`\((i, j)\)\^th\)]], " element of ", Cell[BoxData[ \(TraditionalForm\`c\)]], " is the dot product of the ", Cell[BoxData[ \(TraditionalForm\`i\^th\)]], " row of ", Cell[BoxData[ \(TraditionalForm\`a\)]], " and the ", Cell[BoxData[ \(TraditionalForm\`j\^th\)]], " column of ", Cell[BoxData[ \(TraditionalForm\`b\)]], ". Thus in order to multiply these two matrices, the length of the rows of \ ", Cell[BoxData[ \(TraditionalForm\`a\)]], " must be the same as the length of the columns of ", Cell[BoxData[ \(TraditionalForm\`b\)]], "." }], "Text", Evaluatable->False, TextJustification->1, AspectRatioFixed->True], Cell[BoxData[{ \(\(a = {{1, 2, 3}, {4, 5, 6}}; \)\), \(MatrixForm[a]\)}], "Input", AspectRatioFixed->True], Cell[BoxData[{ \(\(b = {{1, 2}, {3, 4}, {5, 6}}; \)\), \(MatrixForm[b]\)}], "Input", AspectRatioFixed->True], Cell[BoxData[{ \(\(c = a . b; \)\), \(MatrixForm[c]\)}], "Input", AspectRatioFixed->True], Cell[TextData[{ "Notice that the number of rows in ", Cell[BoxData[ \(TraditionalForm\`c\)]], " is the same as the number of rows in ", Cell[BoxData[ \(TraditionalForm\`a\)]], " and the number of columns in ", Cell[BoxData[ \(TraditionalForm\`c\)]], " is the number of columns in ", Cell[BoxData[ \(TraditionalForm\`b\)]], "." }], "Text", Evaluatable->False, TextJustification->1, AspectRatioFixed->True], Cell[TextData[ "Matrix mulitiplication is not commutative. That is, in general\n\ta . b \ \[NotEqual] b . a"], "Text", Evaluatable->False, TextJustification->1, AspectRatioFixed->True], Cell[BoxData[ \(MatrixForm[b . a]\)], "Input", AspectRatioFixed->True], Cell[TextData[{ "We see that in this case, the matrices ", Cell[BoxData[ \(TraditionalForm\`\((a\ . \ b)\)\)]], " and ", Cell[BoxData[ \(TraditionalForm\`\((b\ . \ a)\)\)]], " are not even the same size." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[BoxData[ \(Clear[a, b, c]\)], "Input", AspectRatioFixed->True], Cell[TextData[{ "Matrix multiplication is, however, associative. That is,\n\t", Cell[BoxData[ \(TraditionalForm \`\((a\ . \ b)\)\ . \ c\ \[Equal] \ a\ . \ \((b\ . \ c)\)\)]], "\n", StyleBox["Mathematica", FontSlant->"Italic"], " knows this. If you enter a matrix multiplication with unnecessary \ parentheses, it will remove them in the output." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[BoxData[ \(a . \((b . c)\)\)], "Input", AspectRatioFixed->True] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["Elementary Operations on Matrices", "Section"], Cell[BoxData[ \(MatrixForm[m = {{a, b}, {c, d}}]\)], "Input"], Cell[TextData[{ StyleBox["Mathematica", FontSlant->"Italic"], " has functions to find the transpose and inverse of matrices." }], "Text", TextAlignment->Left, TextJustification->1], Cell[BoxData[ \(Transpose[m] // MatrixForm\)], "Input"], Cell[BoxData[ \(Inverse[m] // MatrixForm\)], "Input"], Cell[TextData[{ StyleBox["Mathematica", FontSlant->"Italic"], " will notify you if you attempt to take the inverse of a singular matrix." }], "Text", TextAlignment->Left, TextJustification->1], Cell[BoxData[ \(MatrixForm[m = {{1, 2}, {2, 4}}]\)], "Input"], Cell[BoxData[ \(Inverse[m] // MatrixForm\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Determinants, Eigenvalues and Eigenvectors", "Section"], Cell[TextData[{ "You can find the determinant of a matrix with the ", StyleBox["Det[]", "Input"], " function." }], "Text", TextAlignment->Left, TextJustification->1], Cell[BoxData[ \(m = Table[1\/\(i + j\), {i, 1, 3}, {j, 1, 3}]; \nMatrixForm[m]\)], "Input"], Cell[BoxData[ \(Det[m]\)], "Input"], Cell[TextData[{ "The characteristic polynomial, ", Cell[BoxData[ \(TraditionalForm\`\[Chi](\[Lambda])\)]], ", of a square matrix, ", Cell[BoxData[ \(TraditionalForm\`A\)]], ", is defined as" }], "Text", TextJustification->1], Cell[BoxData[ \(TraditionalForm\`\[Chi](\[Lambda]) = \(det(A - \[Lambda]\ I) . \)\)], "DisplayFormula", TextAlignment->Center], Cell[BoxData[ \(Det[m - \[Lambda]\ IdentityMatrix[3]]\)], "Input"], Cell[TextData[{ StyleBox["Mathematica", FontSlant->"Italic"], " has a built-in function for calculating the characteristic polynomial." }], "Text", TextJustification->1], Cell[BoxData[ \(CharacteristicPolynomial[m, \[Lambda]]\)], "Input"], Cell["\<\ The eigenvalues of a matrix are the roots of the characteristic \ polynomial.\ \>", "Text", TextAlignment->Left, TextJustification->1], Cell[BoxData[ \(Solve[% == 0, \[Lambda]]\)], "Input"], Cell[TextData[{ StyleBox["Mathematica", FontSlant->"Italic"], " has a built-in function for calculating eigenvalues." }], "Text", TextJustification->1], Cell[BoxData[ \(Eigenvalues[m]\)], "Input"], Cell["\<\ The eigenvalues are the roots of a third order polynomial. Hence \ it is not surprising that they have such a complicated form. A numerical \ approximation is\ \>", "Text", TextAlignment->Left, TextJustification->1], Cell[BoxData[ \(N[%]\)], "Input"], Cell[TextData[{ "The eigenvalues are actually real. The small imaginary parts show up \ because of floating point arithmetic. You can use the ", StyleBox["Chop[]", "Input"], " function to clean up the expression." }], "Text", TextAlignment->Left, TextJustification->1], Cell[BoxData[ \(Chop[%]\)], "Input"], Cell["\<\ If you only wanted a numerical approximation of the eigenvalues to \ start with, it would be much more efficient to find the eigenvalues of a \ numerical matrix.\ \>", "Text", TextAlignment->Left, TextJustification->1], Cell[BoxData[ \(Eigenvalues[N[m]]\)], "Input"], Cell[TextData[{ "The eigenvectors of a matrix are vectors that satisfy ", Cell[BoxData[ \(TraditionalForm\`A\[CenterDot]x = \[Lambda]\ x\)]], " where \[Lambda] is an eigenvalue. The ", StyleBox["Eigenvector[]", "Input"], " function returns a list of the eigenvectors." }], "Text", TextAlignment->Left, TextJustification->1], Cell[BoxData[ \(Eigenvectors[N[m]]\)], "Input"], Cell["You can view this as a matrix with each row an eigenvector.", "Text", TextAlignment->Left, TextJustification->1], Cell[BoxData[ \(MatrixForm[%]\)], "Input"], Cell[TextData[{ "Let ", Cell[BoxData[ \(TraditionalForm\`m\)]], " be a matrix with distinct eigenvalues. If ", Cell[BoxData[ \(TraditionalForm\`v\)]], " is a matrix with the eigenvectors of ", Cell[BoxData[ \(TraditionalForm\`m\)]], " as columns, then the similarity transformation ", Cell[BoxData[ \(TraditionalForm\`v\^\(-1\)\[CenterDot]m\[CenterDot]v\)]], " diagonalizes the matrix ", Cell[BoxData[ \(TraditionalForm\`m\)]], ". ", Cell[BoxData[ \(TraditionalForm\`v\^\(-1\)\[CenterDot]m\[CenterDot]v\)]], " is a diagonal matrix with the eigenvalues of ", Cell[BoxData[ \(TraditionalForm\`m\)]], " as diagonal elements." }], "Text", TextJustification->1], Cell[BoxData[ \(MatrixForm[v = Transpose[%]]\)], "Input"], Cell[BoxData[ \(Inverse[v] . m . v // MatrixForm\)], "Input"], Cell[BoxData[ \(Chop[%] // MatrixForm\)], "Input"], Cell[TextData[{ "You can calculate the eigenvalues and eigenvectors in one step with the ", StyleBox["Eigensystem[]", FontWeight->"Bold"], " function. It returns a list whose first element is a list of the \ eigenvalues and whose second element is a list of lists of the eigenvectors." }], "Text", TextJustification->1], Cell[BoxData[ \(Eigensystem[N[m]]\)], "Input"], Cell[BoxData[ \(% // TableForm\)], "Input"], Cell[BoxData[ \(Clear[m]\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Matrix Operations", "Section"], Cell["Recall that the input", "Text"], Cell[BoxData[ RowBox[{ SuperscriptBox[ RowBox[{"(", GridBox[{ {"a", "b"}, {"c", "d"} }], ")"}], "3"], "//", "MatrixForm"}]], "Input"], Cell[TextData[{ "raised the elements of a matrix to the third power. To raise a matrix to \ a power, use the ", StyleBox["MatrixPower[]", FontWeight->"Bold"], " function." }], "Text", TextAlignment->Left, TextJustification->1], Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"(", GridBox[{ {"1", "2"}, {"3", "4"} }], ")"}], ".", RowBox[{"(", GridBox[{ {"1", "2"}, {"3", "4"} }], ")"}], ".", RowBox[{"(", GridBox[{ {"1", "2"}, {"3", "4"} }], ")"}]}], "//", "MatrixForm"}]], "Input"], Cell[BoxData[ RowBox[{ RowBox[{"MatrixPower", "[", RowBox[{ RowBox[{"(", GridBox[{ {"1", "2"}, {"3", "4"} }], ")"}], ",", "3"}], "]"}], "//", "MatrixForm"}]], "Input"], Cell["The matrix exponential is defined:", "Text"], Cell[BoxData[ FormBox[ FormBox[ \(\[ExponentialE]\^A \[Congruent] I + A + A\^2\/\(2!\) + A\^3\/\(3!\) + \[CenterEllipsis]\), "TraditionalForm"], TraditionalForm]], "Text", TextAlignment->Center], Cell[TextData[{ "Use the ", StyleBox["MatrixExp[]", FontWeight->"Bold"], " function to take the matrix exponential." }], "Text", TextAlignment->Left, TextJustification->1], Cell[BoxData[ RowBox[{ RowBox[{"MatrixExp", "[", RowBox[{"(", GridBox[{ {"1", "2"}, {"0", "3"} }], ")"}], "]"}], "//", "MatrixForm"}]], "Input"], Cell[CellGroupData[{ Cell["Exercise 6", "Subsubsection"], Cell[TextData[{ "The Cayley-Hamilton Theorem states that a matrix satisfies its \ characteristic equation. If ", Cell[BoxData[ \(TraditionalForm\`A\)]], " is an ", Cell[BoxData[ \(TraditionalForm\`n\[Times]n\)]], " matrix with the characteristic polynomial" }], "Text", TextJustification->1], Cell[BoxData[ \(TraditionalForm \`\[Chi](\[Lambda]) = \(\((\(-1\))\)\^n\) \[Lambda]\^n + \(a\_\(n - 1\)\) \[Lambda]\^\(n - 1\) + \[CenterEllipsis] + \(a\_1\) \[Lambda] + a\_0\)], "Text", TextAlignment->Center], Cell["then", "Text"], Cell[BoxData[ FormBox[ RowBox[{\(\[Chi](A)\), "=", RowBox[{ \(\(\((\(-1\))\)\^n\) A\^n + \(a\_\(n - 1\)\) A\^\(n - 1\) + \[CenterEllipsis] + \(a\_1\) A + \(a\_0\) I\), "=", StyleBox["0", FontWeight->"Bold"]}]}], TraditionalForm]], "Text", TextAlignment->Center], Cell[TextData[{ "where ", StyleBox["0", FontWeight->"Bold"], " is the zero matrix." }], "Text"], Cell[TextData[{ "Prove the Cayley-Hamilton theorem for ", Cell[BoxData[ \(TraditionalForm\`2\[Times]2\)]], " matrices using the celebrated method of brute force. That is, find the \ characteristic polynomial for the general ", Cell[BoxData[ \(TraditionalForm\`2\[Times]2\)]], " matrix and verify that the matrix satisfies the equation." }], "Text", TextJustification->1] }, Open ]] }, Closed]], Cell[CellGroupData[{ Cell["Solving Linear Systems", "Section"], Cell[TextData[{ "Consider the linear equation ", Cell[BoxData[ \(TraditionalForm\`m\[CenterDot]x = b\)]], "," }], "Text"], Cell[TextData[{ Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ RowBox[{"(", GridBox[{ {\(m\_\(1\[InvisibleComma] 1\)\), "\[CenterEllipsis]", \(m\_\(1\[InvisibleComma] n\)\)}, {"\[VerticalEllipsis]", "\[DescendingEllipsis]", "\[VerticalEllipsis]"}, {\(m\_\(n\[InvisibleComma] 1\)\), "\[CenterEllipsis]", \(m\_\(n\[InvisibleComma] n\)\)} }], ")"}], RowBox[{"(", GridBox[{ {\(x\_1\)}, {"\[VerticalEllipsis]"}, {\(x\_n\)} }], ")"}]}], "=", RowBox[{"(", GridBox[{ {\(b\_1\)}, {"\[VerticalEllipsis]"}, {\(b\_n\)} }], ")"}]}], TraditionalForm]]], "." }], "Text", TextAlignment->Center], Cell[TextData[{ "If the matrix is non-singular, the solution is defined as ", Cell[BoxData[ \(TraditionalForm\`x = m\^\(-1\)\[CenterDot]b\)]], ". However, finding the inverse of the matrix is not an efficient way to \ solve the equation. Use the ", StyleBox["LinearSolve[]", FontWeight->"Bold"], " function to solve this system." }], "Text", TextJustification->1], Cell[BoxData[ \(\(?LinearSolve\)\)], "Input"], Cell[TextData[{ "Here we solve the system ", Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ RowBox[{"(", GridBox[{ {"1", "2"}, {"3", "4"} }], ")"}], RowBox[{"(", GridBox[{ {"x"}, {"y"} }], ")"}]}], "=", RowBox[{"(", GridBox[{ {"1"}, {"2"} }], ")"}]}], TraditionalForm]]], "." }], "Text"], Cell[BoxData[ RowBox[{"LinearSolve", "[", RowBox[{ RowBox[{"(", GridBox[{ {"1", "2"}, {"3", "4"} }], ")"}], ",", \({1, 2}\)}], "]"}]], "Input"], Cell[TextData[{ "The solution is ", Cell[BoxData[ FormBox[ RowBox[{ RowBox[{"(", GridBox[{ {"x"}, {"y"} }], ")"}], "=", RowBox[{"(", GridBox[{ {"0"}, {\(1\/2\)} }], ")"}]}], TraditionalForm]]], "." }], "Text"] }, Closed]], Cell[CellGroupData[{ Cell["Sparse Matrices", "Section"], Cell[TextData[{ StyleBox["Mathematica", FontSlant->"Italic"], " does not have built in capabilties to handle sparse matrices. Sparse \ matrices typically arise in numerically solving differential equations. ", StyleBox["Mathematica", FontSlant->"Italic"], " does have built in functions for numerically solving ordinary and partial \ differential equations. " }], "Text", TextJustification->1] }, Closed]], Cell[CellGroupData[{ Cell["Solutions", "Section", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell["Solution 1", "Subsubsection"], Cell["First we use the dot product.", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[BoxData[ \(a = {1, 2, 3}; b = {3, 2, 1}; \)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(Solve[\@\(a . a\)\ \@\(b . b\)\ Cos[theta] == a . b, theta]\)], "Input",\ AspectRatioFixed->True], Cell["The approximate value of the angle in radians is", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[BoxData[ \(N[theta /. %\[LeftDoubleBracket]1\[RightDoubleBracket]]\)], "Input", AspectRatioFixed->True], Cell["Now we use the cross product to find the angle.", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[BoxData[ \(c = CrossProduct[a, b]\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(Solve[\@\(a . a\)\ \@\(b . b\)\ Sin[\[Theta]] == \@\(c . c\), \[Theta]] \)], "Input", AspectRatioFixed->True], Cell["\<\ To check with the previous result, we find the approximate value of \ the this angle.\ \>", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[BoxData[ \(N[\[Theta] /. %\[LeftDoubleBracket]1\[RightDoubleBracket]]\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(Clear[a, b, c]\)], "Input", AspectRatioFixed->True] }, Closed]], Cell[CellGroupData[{ Cell["Solution 2", "Subsubsection"], Cell[BoxData[ \(Table[Random[Integer, {0, 9}], {i, 7}, {j, 5}] // MatrixForm\)], "Input",\ AspectRatioFixed->True] }, Closed]], Cell[CellGroupData[{ Cell["Solution 3", "Subsubsection"], Cell[BoxData[ \(Table[x\^i\ y\^j, {i, 3}, {j, 4}] // MatrixForm\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(f[i_, j_] := x\^i\ y\^j; \nArray[f, {3, 4}] // MatrixForm\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(Clear[f]\)], "Input", AspectRatioFixed->True] }, Closed]], Cell[CellGroupData[{ Cell["Solution 4", "Subsubsection"], Cell[BoxData[ \(\(m = {{1, 1, 1, 1, 1}, {1, 2, 3, 4, 5}, {2, 3, 5, 7, 11}, {1, \(-1\), 1, \(-1\), 1}}; \)\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(RowReduce[m] // MatrixForm\)], "Input", AspectRatioFixed->True] }, Closed]], Cell[CellGroupData[{ Cell["Solution 5", "Subsubsection"], Cell[BoxData[{ \(\(m1 = {{1, 1, 1, 1}, {1, 2, 3, 2}, {3, 2, 1, 2}}; \)\), \(\(m2 = {{1, 1, 1, 1}, {1, 2, 3, 2}, {3, 2, 1, 4}}; \)\)}], "Input", AspectRatioFixed->True], Cell[BoxData[ \(RowReduce[m1] // MatrixForm\)], "Input", AspectRatioFixed->True], Cell[TextData[{ "There are an infinite set of solutions to the first set of equations given \ by\n\t", Cell[BoxData[ \(TraditionalForm\`x = z\)]], "\n\t", Cell[BoxData[ \(TraditionalForm\`y = 1 - 2 z\)]], "\nwhere ", Cell[BoxData[ \(TraditionalForm\`z\)]], " is arbitrary." }], "Text", Evaluatable->False, TextJustification->1, AspectRatioFixed->True], Cell[BoxData[ \(RowReduce[m2] // MatrixForm\)], "Input", AspectRatioFixed->True], Cell[TextData[{ "The last row in the above matrix represents the equation\n\t", Cell[BoxData[ \(TraditionalForm\`0 = 1\)]], ".\nThus the second system has no solutions." }], "Text", Evaluatable->False, TextJustification->1, AspectRatioFixed->True] }, Closed]], Cell[CellGroupData[{ Cell["Solution 6", "Subsubsection"], Cell[TextData[{ "First we define the general ", Cell[BoxData[ \(TraditionalForm\`2\[Times]2\)]], " matrix with elements ", Cell[BoxData[ \(TraditionalForm\`f\_\(i, j\)\)]], "." }], "Text", TextJustification->1], Cell[BoxData[ \(MatrixForm[m = Array[f, {2, 2}]]\)], "Input"], Cell["We find the characteristic polynomial", "Text"], Cell[BoxData[ \(CharacteristicPolynomial[m, \[Lambda]]\)], "Input"], Cell[BoxData[ \(Collect[%, \[Lambda]]\)], "Input"], Cell["and substitute the matrix into the polynomial.", "Text"], Cell[BoxData[ \(MatrixPower[m, 2] + \((\(-f[1, 1]\) - f[2, 2])\) m + \((f[1, 1]\ f[2, 2] - f[1, 2]\ f[2, 1])\) IdentityMatrix[2]\)], "Input"], Cell["\<\ By simplifying the above expression we see that the matrix does \ satisfy the characteristic equation.\ \>", "Text", TextJustification->1], Cell[BoxData[ \(\(% // Simplify\) // MatrixForm\)], "Input"] }, Closed]] }, Closed]] }, Open ]] }, FrontEndVersion->"5.2 for Microsoft Windows", ScreenRectangle->{{0, 1680}, {0, 963}}, WindowToolbars->"EditBar", CellGrouping->Automatic, WindowSize->{772, 476}, WindowMargins->{{2, Automatic}, {Automatic, 2}}, PrivateNotebookOptions->{"ColorPalette"->{RGBColor, 128}}, ShowCellLabel->True, ShowCellTags->False, RenderingOptions->{"ObjectDithering"->True, "RasterDithering"->False}, CharacterEncoding->"XAutomaticEncoding", Magnification->1.5 ] (******************************************************************* Cached data follows. If you edit this Notebook file directly, not using Mathematica, you must remove the line containing CacheID at the top of the file. The cache data will then be recreated when you save this file from within Mathematica. *******************************************************************) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[1776, 53, 98, 3, 141, "Title", Evaluatable->False], Cell[1877, 58, 439, 14, 125, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[2341, 76, 87, 2, 109, "Section", Evaluatable->False], Cell[2431, 80, 175, 7, 47, "Text", Evaluatable->False], Cell[2609, 89, 78, 2, 42, "Input"], Cell[2690, 93, 205, 7, 48, "Text", Evaluatable->False], Cell[2898, 102, 75, 2, 42, "Input"], Cell[2976, 106, 113, 2, 47, "Text", Evaluatable->False], Cell[3092, 110, 75, 2, 42, "Input"], Cell[3170, 114, 80, 2, 42, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[3287, 121, 84, 2, 62, "Section", Evaluatable->False], Cell[3374, 125, 271, 10, 48, "Text", Evaluatable->False], Cell[3648, 137, 84, 2, 42, "Input"], Cell[3735, 141, 105, 2, 42, "Input"], Cell[3843, 145, 110, 2, 42, "Input"], Cell[3956, 149, 105, 2, 42, "Input"], Cell[4064, 153, 110, 2, 42, "Input"], Cell[4177, 157, 172, 6, 47, "Text", Evaluatable->False], Cell[4352, 165, 72, 2, 42, "Input"], Cell[4427, 169, 71, 2, 42, "Input"], Cell[4501, 173, 69, 2, 42, "Input"], Cell[4573, 177, 137, 3, 47, "Text", Evaluatable->False], Cell[4713, 182, 116, 2, 42, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[4866, 189, 88, 2, 62, "Section", Evaluatable->False], Cell[CellGroupData[{ Cell[4979, 195, 80, 2, 68, "Subsection", Evaluatable->False], Cell[5062, 199, 199, 6, 73, "Text", Evaluatable->False], Cell[5264, 207, 68, 2, 42, "Input"], Cell[5335, 211, 196, 6, 73, "Text", Evaluatable->False], Cell[5534, 219, 66, 2, 42, "Input"], Cell[5603, 223, 66, 2, 42, "Input"], Cell[5672, 227, 188, 6, 47, "Text", Evaluatable->False], Cell[5863, 235, 69, 2, 42, "Input"], Cell[5935, 239, 69, 2, 42, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[6041, 246, 85, 2, 42, "Subsection", Evaluatable->False], Cell[6129, 250, 349, 9, 99, "Text", Evaluatable->False], Cell[6481, 261, 80, 2, 42, "Input"], Cell[6564, 265, 170, 3, 47, "Text"], Cell[6737, 270, 87, 2, 42, "Input"], Cell[6827, 274, 252, 8, 74, "Text", Evaluatable->False], Cell[7082, 284, 76, 2, 47, "Input"], Cell[7161, 288, 76, 2, 42, "Input"], Cell[7240, 292, 229, 7, 73, "Text", Evaluatable->False], Cell[7472, 301, 74, 2, 42, "Input"], Cell[7549, 305, 120, 3, 59, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[7706, 313, 87, 2, 42, "Subsection", Evaluatable->False], Cell[7796, 317, 258, 8, 74, "Text", Evaluatable->False], Cell[8057, 327, 86, 2, 42, "Input"], Cell[8146, 331, 93, 2, 42, "Input"], Cell[8242, 335, 140, 3, 47, "Text", Evaluatable->False], Cell[8385, 340, 101, 2, 42, "Input"], Cell[8489, 344, 173, 6, 47, "Text", Evaluatable->False], Cell[8665, 352, 86, 2, 42, "Input"], Cell[8754, 356, 86, 2, 42, "Input"], Cell[8843, 360, 71, 2, 42, "Input"], Cell[8917, 364, 319, 8, 99, "Text", Evaluatable->False], Cell[9239, 374, 93, 2, 42, "Input"], Cell[9335, 378, 266, 7, 73, "Text", Evaluatable->False], Cell[9604, 387, 112, 3, 68, "Input"], Cell[9719, 392, 81, 2, 42, "Input"], Cell[9803, 396, 98, 2, 47, "Input"], Cell[9904, 400, 73, 2, 42, "Input"], Cell[CellGroupData[{ Cell[10002, 406, 35, 0, 61, "Subsubsection"], Cell[10040, 408, 296, 9, 73, "Text"] }, Open ]] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[10397, 424, 88, 2, 62, "Section", Evaluatable->False], Cell[10488, 428, 254, 9, 47, "Text", Evaluatable->False], Cell[10745, 439, 79, 2, 42, "Input"], Cell[10827, 443, 221, 7, 48, "Text", Evaluatable->False], Cell[11051, 452, 72, 2, 42, "Input"], Cell[11126, 456, 202, 7, 48, "Text", Evaluatable->False], Cell[11331, 465, 74, 2, 42, "Input"], Cell[11408, 469, 67, 2, 42, "Input"], Cell[11478, 473, 1331, 35, 224, "Text"], Cell[12812, 510, 752, 29, 127, "Text", Evaluatable->False], Cell[13567, 541, 101, 2, 42, "Input"], Cell[13671, 545, 219, 8, 47, "Text", Evaluatable->False], Cell[13893, 555, 97, 2, 42, "Input"], Cell[13993, 559, 577, 22, 128, "Text", Evaluatable->False], Cell[14573, 583, 111, 2, 68, "Input"], Cell[14687, 587, 254, 9, 48, "Text", Evaluatable->False], Cell[14944, 598, 111, 3, 68, "Input"], Cell[15058, 603, 131, 3, 47, "Text", Evaluatable->False], Cell[15192, 608, 102, 3, 68, "Input"], Cell[15297, 613, 70, 2, 42, "Input"], Cell[15370, 617, 274, 8, 100, "Text", Evaluatable->False], Cell[15647, 627, 101, 2, 42, "Input"], Cell[15751, 631, 257, 10, 48, "Text", Evaluatable->False], Cell[16011, 643, 90, 2, 42, "Input"], Cell[CellGroupData[{ Cell[16126, 649, 35, 0, 61, "Subsubsection"], Cell[16164, 651, 116, 4, 47, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[16317, 660, 35, 0, 61, "Subsubsection"], Cell[16355, 662, 399, 15, 73, "Text"] }, Open ]] }, Closed]], Cell[CellGroupData[{ Cell[16803, 683, 98, 2, 62, "Section", Evaluatable->False], Cell[CellGroupData[{ Cell[16926, 689, 101, 2, 68, "Subsection", Evaluatable->False], Cell[17030, 693, 256, 9, 48, "Text", Evaluatable->False], Cell[17289, 704, 123, 3, 68, "Input"], Cell[17415, 709, 222, 6, 73, "Text", Evaluatable->False], Cell[17640, 717, 105, 2, 42, "Input"], Cell[17748, 721, 105, 2, 42, "Input"], Cell[17856, 725, 141, 3, 68, "Input"], Cell[18000, 730, 239, 9, 48, "Text", Evaluatable->False], Cell[18242, 741, 102, 2, 42, "Input"], Cell[18347, 745, 102, 2, 42, "Input"], Cell[18452, 749, 229, 8, 74, "Text", Evaluatable->False], Cell[18684, 759, 85, 2, 42, "Input"], Cell[18772, 763, 239, 8, 74, "Text", Evaluatable->False], Cell[19014, 773, 117, 2, 42, "Input"], Cell[19134, 777, 46, 1, 42, "Input"], Cell[19183, 780, 263, 7, 73, "Text"], Cell[19449, 789, 70, 1, 42, "Input"], Cell[19522, 792, 175, 5, 48, "Text"], Cell[19700, 799, 44, 1, 42, "Input"], Cell[19747, 802, 133, 4, 47, "Text"], Cell[19883, 808, 80, 1, 42, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[20000, 814, 122, 2, 42, "Subsection", Evaluatable->False], Cell[20125, 818, 755, 25, 255, "Text", Evaluatable->False], Cell[20883, 845, 486, 18, 73, "Text", Evaluatable->False], Cell[21372, 865, 142, 3, 68, "Input"], Cell[21517, 870, 282, 9, 73, "Text", Evaluatable->False], Cell[21802, 881, 302, 6, 94, "Input"], Cell[22107, 889, 135, 3, 47, "Text", Evaluatable->False], Cell[22245, 894, 196, 4, 68, "Input"], Cell[22444, 900, 192, 6, 47, "Text", Evaluatable->False], Cell[22639, 908, 370, 7, 120, "Input"], Cell[23012, 917, 180, 6, 47, "Text", Evaluatable->False], Cell[23195, 925, 188, 4, 68, "Input"], Cell[23386, 931, 362, 14, 125, "Text", Evaluatable->False], Cell[23751, 947, 208, 7, 48, "Text", Evaluatable->False], Cell[23962, 956, 142, 3, 68, "Input"], Cell[24107, 961, 85, 2, 42, "Input"], Cell[CellGroupData[{ Cell[24217, 967, 35, 0, 61, "Subsubsection"], Cell[24255, 969, 508, 16, 177, "Text"], Cell[24766, 987, 185, 4, 94, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[24988, 996, 35, 0, 61, "Subsubsection"], Cell[25026, 998, 716, 23, 333, "Text"], Cell[25745, 1023, 178, 3, 68, "Input"] }, Open ]] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[25984, 1033, 99, 2, 62, "Section", Evaluatable->False], Cell[CellGroupData[{ Cell[26108, 1039, 98, 2, 68, "Subsection", Evaluatable->False], Cell[26209, 1043, 111, 3, 68, "Input"], Cell[26323, 1048, 101, 3, 68, "Input"], Cell[26427, 1053, 387, 8, 125, "Text", Evaluatable->False], Cell[26817, 1063, 76, 2, 42, "Input"], Cell[26896, 1067, 447, 13, 151, "Text", Evaluatable->False], Cell[27346, 1082, 98, 3, 68, "Input"], Cell[27447, 1087, 190, 7, 48, "Text", Evaluatable->False], Cell[27640, 1096, 79, 2, 42, "Input"], Cell[27722, 1100, 73, 2, 42, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[27832, 1107, 98, 2, 42, "Subsection", Evaluatable->False], Cell[27933, 1111, 1030, 40, 125, "Text", Evaluatable->False], Cell[28966, 1153, 117, 3, 68, "Input"], Cell[29086, 1158, 119, 3, 68, "Input"], Cell[29208, 1163, 100, 3, 68, "Input"], Cell[29311, 1168, 452, 17, 73, "Text", Evaluatable->False], Cell[29766, 1187, 193, 5, 73, "Text", Evaluatable->False], Cell[29962, 1194, 76, 2, 42, "Input"], Cell[30041, 1198, 288, 10, 47, "Text", Evaluatable->False], Cell[30332, 1210, 73, 2, 42, "Input"], Cell[30408, 1214, 438, 12, 125, "Text", Evaluatable->False], Cell[30849, 1228, 74, 2, 42, "Input"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[30972, 1236, 52, 0, 62, "Section"], Cell[31027, 1238, 65, 1, 42, "Input"], Cell[31095, 1241, 192, 6, 47, "Text"], Cell[31290, 1249, 59, 1, 42, "Input"], Cell[31352, 1252, 57, 1, 42, "Input"], Cell[31412, 1255, 204, 6, 47, "Text"], Cell[31619, 1263, 65, 1, 42, "Input"], Cell[31687, 1266, 57, 1, 42, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[31781, 1272, 61, 0, 62, "Section"], Cell[31845, 1274, 175, 6, 48, "Text"], Cell[32023, 1282, 98, 2, 96, "Input"], Cell[32124, 1286, 39, 1, 42, "Input"], Cell[32166, 1289, 248, 9, 47, "Text"], Cell[32417, 1300, 135, 3, 35, "DisplayFormula"], Cell[32555, 1305, 70, 1, 42, "Input"], Cell[32628, 1308, 179, 5, 47, "Text"], Cell[32810, 1315, 71, 1, 42, "Input"], Cell[32884, 1318, 148, 5, 47, "Text"], Cell[33035, 1325, 57, 1, 42, "Input"], Cell[33095, 1328, 161, 5, 47, "Text"], Cell[33259, 1335, 47, 1, 42, "Input"], Cell[33309, 1338, 231, 6, 73, "Text"], Cell[33543, 1346, 37, 1, 42, "Input"], Cell[33583, 1349, 280, 7, 74, "Text"], Cell[33866, 1358, 40, 1, 42, "Input"], Cell[33909, 1361, 232, 6, 73, "Text"], Cell[34144, 1369, 50, 1, 42, "Input"], Cell[34197, 1372, 344, 9, 75, "Text"], Cell[34544, 1383, 51, 1, 42, "Input"], Cell[34598, 1386, 122, 2, 47, "Text"], Cell[34723, 1390, 46, 1, 42, "Input"], Cell[34772, 1393, 732, 24, 99, "Text"], Cell[35507, 1419, 61, 1, 42, "Input"], Cell[35571, 1422, 65, 1, 42, "Input"], Cell[35639, 1425, 54, 1, 42, "Input"], Cell[35696, 1428, 332, 7, 99, "Text"], Cell[36031, 1437, 50, 1, 42, "Input"], Cell[36084, 1440, 47, 1, 42, "Input"], Cell[36134, 1443, 41, 1, 42, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[36212, 1449, 36, 0, 47, "Section"], Cell[36251, 1451, 37, 0, 47, "Text"], Cell[36291, 1453, 193, 6, 58, "Input"], Cell[36487, 1461, 241, 8, 73, "Text"], Cell[36731, 1471, 408, 14, 59, "Input"], Cell[37142, 1487, 244, 7, 59, "Input"], Cell[37389, 1496, 50, 0, 47, "Text"], Cell[37442, 1498, 233, 6, 67, "Text"], Cell[37678, 1506, 185, 7, 47, "Text"], Cell[37866, 1515, 205, 6, 59, "Input"], Cell[CellGroupData[{ Cell[38096, 1525, 35, 0, 61, "Subsubsection"], Cell[38134, 1527, 316, 10, 73, "Text"], Cell[38453, 1539, 244, 6, 46, "Text"], Cell[38700, 1547, 20, 0, 47, "Text"], Cell[38723, 1549, 326, 8, 46, "Text"], Cell[39052, 1559, 105, 5, 47, "Text"], Cell[39160, 1566, 394, 10, 99, "Text"] }, Open ]] }, Closed]], Cell[CellGroupData[{ Cell[39603, 1582, 41, 0, 47, "Section"], Cell[39647, 1584, 133, 5, 47, "Text"], Cell[39783, 1591, 909, 25, 89, "Text"], Cell[40695, 1618, 387, 10, 99, "Text"], Cell[41085, 1630, 49, 1, 42, "Input"], Cell[41137, 1633, 503, 19, 63, "Text"], Cell[41643, 1654, 204, 6, 59, "Input"], Cell[41850, 1662, 346, 14, 76, "Text"] }, Closed]], Cell[CellGroupData[{ Cell[42233, 1681, 34, 0, 47, "Section"], Cell[42270, 1683, 414, 10, 99, "Text"] }, Closed]], Cell[CellGroupData[{ Cell[42721, 1698, 76, 2, 47, "Section", Evaluatable->False], Cell[CellGroupData[{ Cell[42822, 1704, 35, 0, 61, "Subsubsection"], Cell[42860, 1706, 93, 2, 47, "Text", Evaluatable->False], Cell[42956, 1710, 89, 2, 42, "Input"], Cell[43048, 1714, 120, 3, 49, "Input"], Cell[43171, 1719, 112, 2, 47, "Text", Evaluatable->False], Cell[43286, 1723, 114, 2, 42, "Input"], Cell[43403, 1727, 111, 2, 47, "Text", Evaluatable->False], Cell[43517, 1731, 81, 2, 42, "Input"], Cell[43601, 1735, 137, 3, 49, "Input"], Cell[43741, 1740, 157, 5, 47, "Text", Evaluatable->False], Cell[43901, 1747, 117, 2, 42, "Input"], Cell[44021, 1751, 73, 2, 42, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[44131, 1758, 35, 0, 38, "Subsubsection"], Cell[44169, 1760, 121, 3, 42, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[44327, 1768, 35, 0, 38, "Subsubsection"], Cell[44365, 1770, 106, 2, 42, "Input"], Cell[44474, 1774, 116, 2, 68, "Input"], Cell[44593, 1778, 67, 2, 42, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[44697, 1785, 35, 0, 38, "Subsubsection"], Cell[44735, 1787, 159, 3, 68, "Input"], Cell[44897, 1792, 85, 2, 42, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[45019, 1799, 35, 0, 38, "Subsubsection"], Cell[45057, 1801, 178, 3, 68, "Input"], Cell[45238, 1806, 86, 2, 42, "Input"], Cell[45327, 1810, 390, 15, 125, "Text", Evaluatable->False], Cell[45720, 1827, 86, 2, 42, "Input"], Cell[45809, 1831, 265, 8, 99, "Text", Evaluatable->False] }, Closed]], Cell[CellGroupData[{ Cell[46111, 1844, 35, 0, 38, "Subsubsection"], Cell[46149, 1846, 234, 9, 47, "Text"], Cell[46386, 1857, 65, 1, 42, "Input"], Cell[46454, 1860, 53, 0, 47, "Text"], Cell[46510, 1862, 71, 1, 42, "Input"], Cell[46584, 1865, 54, 1, 42, "Input"], Cell[46641, 1868, 62, 0, 47, "Text"], Cell[46706, 1870, 152, 2, 68, "Input"], Cell[46861, 1874, 150, 4, 73, "Text"], Cell[47014, 1880, 64, 1, 42, "Input"] }, Closed]] }, Closed]] }, Open ]] } ] *) (******************************************************************* End of Mathematica Notebook file. *******************************************************************)