📚 The CoCalc Library - books, templates and other resources
License: OTHER
<?xml version="1.0" encoding="UTF-8" ?>12<!-- Sage and Linear Algebra Worksheets -->3<!-- Robert A. Beezer -->4<!-- Copyright 2017-2019 License: CC BY-SA -->5<!-- See COPYING for more information -->67<pretext xmlns:xi="http://www.w3.org/2001/XInclude">89<xi:include href="../worksheetinfo.xml" />1011<article xml:id="MISLE">12<title>Sage and Linear Algebra Worksheet</title>13<subtitle>FCLA Section MISLE</subtitle>1415<!-- header inclusion needs -xinclude switch on xsltproc -->16<frontmatter>17<xi:include href="../header.xml" />18</frontmatter>1920<section>21<title>An Invertible Matrix</title>2223<p>An invertible <m>6\times 6</m> matrix.</p>2425<sage>26<input>27A = matrix(QQ, [[ 1, 2, -1, -2, -1, -6],28[-2, -3, 1, 3, 1, 6],29[ 2, 4, -1, -4, 0, -7],30[ 0, -1, 1, 2, -1, 1],31[ 2, 4, -2, -4, -1, -8],32[ 1, 0, 0, 0, -1, 2]])33A34</input>35</sage>3637<sage>38<input>39Ainv = A.inverse()40Ainv41</input>42</sage>4344<sage>45<input>46Ainv*A47</input>48</sage>4950<sage>51<input>52A*Ainv53</input>54</sage>5556<p>Building the inverse, now column by column, by solving systems of equations with the vector of constants equal to columns of an identity matrix.</p>5758<exercise>59<statement>60<p>Edit and re-run the next cell, using several different columns of the identity matrix. Compare the solution vectors with the columns of the inverse of <c>A</c> above.</p>61</statement>62</exercise>6364<sage>65<input>66y = vector(QQ, [1,0,0,0,0,0])67P = A.augment(y, subdivide=True)68P.rref()69</input>70</sage>7172<p>Consolidating the above as the following illustrates Theorem CINM and its proof.</p>7374<sage>75<input>76B = A.augment(identity_matrix(6), subdivide=True)77B78</input>79</sage>8081<sage>82<input>83B.rref()84</input>85</sage>8687</section>8889<section>90<title>A Matrix Without an Inverse</title>9192<p>Now, a non-invertible <m>6\times 6</m> matrix.</p>9394<sage>95<input>96C = matrix(QQ, [[-1, 0, 2, 8, 8, 0],97[-1, -1, 0, 1, 0, 3],98[-1, -2, -1, -4, -4, 5],99[ 1, 2, 1, 4, 5, -5],100[-1, -1, -1, -1, -8, 4],101[ 0, 1, 0, 3, 5, -1]])102C103</input>104</sage>105106<sage>107<input>108C.inverse()109</input>110</sage>111112<exercise>113<statement>114<p>Edit and re-run the next cell, using several different columns of the identity matrix, in attempts to construct columns of the inverse. Just one of these failures is enough to be certain that <c>A</c> does not have an inverse, following the logic of Example MWIAA.</p>115</statement>116</exercise>117118<sage>119<input>120y = vector(QQ, [1,0,0,0,0,0])121P = C.augment(y, subdivide=True)122P.rref()123</input>124</sage>125126<p>It is the case that <em>no</em> column of the identity matrix leads to a consistent system (for this matrix). We can see all six systems with a computation reminiscent of Theorem CINM.</p>127128<sage>129<input>130D = C.augment(identity_matrix(6), subdivide=True)131D132</input>133</sage>134135<sage>136<input>137D.rref()138</input>139</sage>140141<exercise>142<statement>143<p>You might struggle to find <em>any</em> vector of constants that will combine with <c>C</c> to be a consistent systems. (Though there are some. And I can think of seven that are real easy to find if you think about it a bit.)</p>144</statement>145</exercise>146147<sage>148<input>149w = vector(QQ, [ ])150P = C.augment(w, subdivide=True)151P.rref()152</input>153</sage>154155<exercise>156<statement>157<p>Do you see the fundamental difference between the matrices <c>A</c> and <c>B</c>?</p>158</statement>159</exercise>160161<sage />162</section>163164<xi:include href="../legal.xml" />165166</article>167168</pretext>169170171