(************** Content-type: application/mathematica ************** CreatedBy='Mathematica 5.1' 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[ 6712, 214]*) (*NotebookOutlinePosition[ 7409, 238]*) (* CellTagsIndexPosition[ 7365, 234]*) (*WindowFrame->Normal*) Notebook[{ Cell[CellGroupData[{ Cell["Elementary Row Operations", "Title"], Cell[CellGroupData[{ Cell["Elementary Row Operations", "Section"], Cell["\<\ Elementary row operations: \tReplace: replace one row by the sum of that row and a constant multiple of \ another row. \tSwap: interchange two rows \tScale: multiply a row by a non-zero constant Let's use the elementary row operations to reduce a matrix to row echelon \ form. \ \>", "Text"], Cell[BoxData[ RowBox[{ RowBox[{"a", "=", RowBox[{"(", GridBox[{ {"1", \(-2\), "1", "0"}, {"2", "0", \(-8\), "8"}, {\(-4\), "5", "9", \(-9\)} }], ")"}]}], ";"}]], "Input"], Cell[BoxData[{ \(\(a[\([2]\)] = a[\([2]\)] - 2 a[\([1]\)];\)\), "\[IndentingNewLine]", \(a // MatrixForm\)}], "Input"], Cell[BoxData[{ \(\(a[\([3]\)] = a[\([3]\)] + 4 a[\([1]\)];\)\), "\[IndentingNewLine]", \(a // MatrixForm\)}], "Input"], Cell[BoxData[{ \(\(a[\([3]\)] = a[\([3]\)] + 3/4 a[\([2]\)];\)\), "\[IndentingNewLine]", \(a // MatrixForm\)}], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Elementary Matrices", "Section"], Cell[TextData[{ "Define procedures which create ", StyleBox["elementary matrices", FontWeight->"Bold"], ".\nPremultiplication of a given matrix by an elementary matrix effects an \ ", StyleBox["elementary row operation", FontWeight->"Bold"], "." }], "Text"], Cell[BoxData[{ \(\(\(eReplace[n_, i_, a_, j_] := \[IndentingNewLine]Module[{e = IdentityMatrix[n]}, \[IndentingNewLine]e[\([i]\)] = e[\([i]\)] + a\ e[\([j]\)]; e]\)\(\[IndentingNewLine]\) \)\), "\[IndentingNewLine]", \(\(\(eSwap[n_, i_, j_] := \[IndentingNewLine]Module[{e = IdentityMatrix[n], temp}, \[IndentingNewLine]\ temp = e[\([i]\)]; e[\([i]\)] = \ e[\([j]\)]; e[\([j]\)] = temp; e]\)\(\[IndentingNewLine]\) \)\), "\[IndentingNewLine]", \(eScale[n_, i_, a_] := \[IndentingNewLine]Module[{e = IdentityMatrix[n]}, \[IndentingNewLine]e[\([i]\)] = \ a\ e[\([i]\)]; e]\)}], "Input"], Cell["Testing. Create some elementary matrices.", "Text"], Cell[BoxData[{ RowBox[{ RowBox[{ RowBox[{"a", "=", RowBox[{"(", GridBox[{ {"1", \(-2\), "1", "0"}, {"2", "0", \(-8\), "8"}, {\(-4\), "5", "9", \(-9\)} }], ")"}]}], ";"}], "\[IndentingNewLine]"}], "\[IndentingNewLine]", \(eReplace[3, 2, \(-2\), 1] // MatrixForm\), "\[IndentingNewLine]", \(eSwap[3, 1, 2] // MatrixForm\), "\[IndentingNewLine]", \(eScale[3, 1, \(-1\)] // MatrixForm\)}], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Echelon Form", "Section"], Cell["\<\ Use elementary row operations to reduce a matrix to row echelon \ form. Premultiplication by elementary matrices accomplishes the \ transformation.\ \>", "Text"], Cell[BoxData[{ RowBox[{ RowBox[{ RowBox[{"a", "=", RowBox[{"(", GridBox[{ {"1", \(-2\), "1", "0"}, {"2", "0", \(-8\), "8"}, {\(-4\), "5", "9", \(-9\)} }], ")"}]}], ";"}], "\[IndentingNewLine]"}], "\[IndentingNewLine]", \(e1 = eReplace[3, 2, \(-2\), 1];\), "\[IndentingNewLine]", RowBox[{\(e2 = eReplace[3, 3, 4, 1];\), "\[IndentingNewLine]"}], "\[IndentingNewLine]", \(e2 . e1 . a;\), "\[IndentingNewLine]", \(% // MatrixForm\)}], "Input"], Cell[BoxData[{ \(\(\(e3 = eReplace[3, 3, 3/4, 2];\)\(\[IndentingNewLine]\) \)\), "\[IndentingNewLine]", \(\(e3 . e2 . e1 . a;\)\), "\[IndentingNewLine]", \(% // MatrixForm\)}], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Reduced Echelon Form", "Section"], Cell["Use row reduction to solve a system of linear equations.", "Text"], Cell[BoxData[{ RowBox[{ RowBox[{ RowBox[{"a", "=", RowBox[{"(", GridBox[{ {"1", \(-2\), "1", "0"}, {"0", "2", \(-8\), "8"}, {\(-4\), "5", "9", \(-9\)} }], ")"}]}], ";"}], "\[IndentingNewLine]"}], "\[IndentingNewLine]", \(r = RowReduce[a];\), "\[IndentingNewLine]", \(% // MatrixForm\)}], "Input"], Cell["Let's check that.", "Text"], Cell[BoxData[ \(<< LinearAlgebra`MatrixManipulation`\)], "Input"], Cell[BoxData[{ \(\(m = TakeColumns[a, 3];\)\), "\[IndentingNewLine]", \(\(\(% // MatrixForm\)\(\[IndentingNewLine]\) \)\), "\[IndentingNewLine]", \(\(s = TakeColumns[r, \(-1\)];\)\), "\[IndentingNewLine]", \(\(\(% // MatrixForm\)\(\[IndentingNewLine]\) \)\), "\[IndentingNewLine]", \(\(b = TakeColumns[a, \(-1\)];\)\), "\[IndentingNewLine]", \(\(\(% // MatrixForm\)\(\[IndentingNewLine]\) \)\), "\[IndentingNewLine]", \(m . s \[Equal] b\)}], "Input"] }, Closed]] }, Open ]] }, FrontEndVersion->"5.1 for Macintosh", ScreenRectangle->{{4, 1280}, {0, 832}}, WindowSize->{810, 778}, WindowMargins->{{104, Automatic}, {Automatic, 0}}, CellLabelAutoDelete->True, StyleDefinitions -> "Report.nb" ] (******************************************************************* 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, 42, 0, 74, "Title"], Cell[CellGroupData[{ Cell[1843, 57, 44, 0, 67, "Section"], Cell[1890, 59, 302, 10, 124, "Text"], Cell[2195, 71, 245, 7, 62, "Input"], Cell[2443, 80, 128, 2, 48, "Input"], Cell[2574, 84, 128, 2, 48, "Input"], Cell[2705, 88, 139, 3, 48, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[2881, 96, 38, 0, 41, "Section"], Cell[2922, 98, 275, 9, 44, "Text"], Cell[3200, 109, 710, 15, 192, "Input"], Cell[3913, 126, 57, 0, 28, "Text"], Cell[3973, 128, 524, 13, 129, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[4534, 146, 31, 0, 41, "Section"], Cell[4568, 148, 172, 5, 44, "Text"], Cell[4743, 155, 569, 13, 161, "Input"], Cell[5315, 170, 203, 4, 80, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[5555, 179, 39, 0, 41, "Section"], Cell[5597, 181, 72, 0, 28, "Text"], Cell[5672, 183, 405, 10, 113, "Input"], Cell[6080, 195, 33, 0, 28, "Text"], Cell[6116, 197, 69, 1, 32, "Input"], Cell[6188, 200, 496, 10, 176, "Input"] }, Closed]] }, Open ]] } ] *) (******************************************************************* End of Mathematica Notebook file. *******************************************************************)