Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

📚 The CoCalc Library - books, templates and other resources

132935 views
License: OTHER
%auto %html(hide=True) <div class="mathbook-content"> <link rel="stylesheet" type="text/css" href="http://buzzard.ups.edu/mathbook-content.css"> <link rel="stylesheet" type="text/css" href="https://aimath.org/mathbook/mathbook-add-on.css"> </div>
%auto %html(hide=True) <div class="mathbook-content"><div class="hidden-content" style="display:none">\( \newcommand{\lt}{&lt;} \newcommand{\gt}{&gt;} \newcommand{\amp}{&amp;} \)</div></div>
%auto %html(hide=True) <div class="mathbook-content"><table width="90%" style="font-size: 200%;"><tr></tr></table></div>
%auto %html(hide=True) <div class="mathbook-content"><section class="article" id="FS"></section></div>
%auto %html(hide=True) <div class="mathbook-content"><section class="frontmatter" id="frontmatter-1"></section></div>
%auto %html(hide=True) <div class="mathbook-content"> <h2 class="heading"> <span class="title">Sage and Linear Algebra Worksheet:</span> <span class="subtitle">FCLA Section FS</span> </h2> <div class="author"> <div class="author-name">Robert Beezer</div> <div class="author-info">Department of Mathematics and Computer Science<br>University of Puget Sound</div> </div> <div class="date">Fall 2019</div> </div>
%auto %html(hide=True) <div class="mathbook-content"><section class="section" id="section-1"><h6 class="heading hide-type"> <span class="type">Section</span> <span class="codenumber">1</span> <span class="title">Four Subsets</span> </h6></section></div>
%auto %html(hide=True) <div class="mathbook-content"><p id="p-1"><code class="code-inline tex2jax_ignore">A</code> is an \(8\times 10\) matrix.</p></div>
A = matrix(QQ, [[194, -41, -899, -396, 49, 112, 874, -355, 1139, -1221], [269, -57, -1247, -549, 68, 155, 1212, -492, 1579, -1693], [16, -3, -73, -33, 4, 10, 72, -30, 95, -101], [115, -24, -532, -235, 29, 67, 518, -211, 676, -724], [ 10, 1, -37, -23, 2, 12, 44, -24, 67, -65], [-59, 13, 275, 120, -15, -33, -266, 107, -345, 371], [ 36, -7, -165, -74, 9, 22, 162, -67, 213, -227], [-20, 4, 92, 41, -5, -12, -90, 37, -118, 126]]) A
%auto %html(hide=True) <div class="mathbook-content"><p id="p-2">We get the extended echelon form, along with the natural subdivisions into four submatrices. We unpack the four submatrices, and stack them in pairs to also get the left and right portions.</p></div>
N = A.extended_echelon_form(subdivide=True) N
C = N.subdivision(0,0) Z = N.subdivision(1,0) K = N.subdivision(0,1) L = N.subdivision(1,1)
%auto %html(hide=True) <div class="mathbook-content"><p id="p-3">And build two bigger pieces.</p></div>
B = C.stack(Z) J = K.stack(L)
B
J
%auto %html(hide=True) <div class="mathbook-content"><article class="exercise-like" id="exercise-1"><h6 class="heading"> <span class="type">Demonstration</span> <span class="codenumber">1</span>.</h6> <p id="p-4">Verify some of the properties of these matrices, as given in Theorem PEEF.</p> <ol class="decimal"> <li id="li-1">Is <code class="code-inline tex2jax_ignore">J</code> nonsingular?</li> <li id="li-2">How are <code class="code-inline tex2jax_ignore">A</code>, <code class="code-inline tex2jax_ignore">B</code>, and <code class="code-inline tex2jax_ignore">J</code> related? Observe that the matrix <code class="code-inline tex2jax_ignore">J</code> effectively reproduces the net effect of a sequence of row operations that converts <code class="code-inline tex2jax_ignore">A</code> to <code class="code-inline tex2jax_ignore">B</code>.</li> </ol></article></div>
%auto %html(hide=True) <div class="mathbook-content"><p id="p-5">Imagine the equation in the last part of the exercise, but instead replace \(A\) by an augmented matrix of a linear system with a vector of constants <code class="code-inline tex2jax_ignore">b</code>. The row operations that convert <code class="code-inline tex2jax_ignore">A</code> to <code class="code-inline tex2jax_ignore">B</code>, will also act on the vector of constants. Will the result be a pivot column (an inconsistent system) or a vector with zeros in all of the same rows as the zero rows of <code class="code-inline tex2jax_ignore">B</code>? Equivalent question: is the vector of constants outside the column space, or within the column space?</p></div>
%auto %html(hide=True) <div class="mathbook-content"><p id="p-6">The answer to the first question is that the zeros will occur in the proper entries to avoid a pivot column exactly if <code class="code-inline tex2jax_ignore">b</code> is in the null space of the matrix <code class="code-inline tex2jax_ignore">L</code>. So consistent systems come from the vectors in the null space of <code class="code-inline tex2jax_ignore">L</code>, and by Theorem CSCS, we know this set of vectors is also the column space.</p></div>
%auto %html(hide=True) <div class="mathbook-content"><article class="exercise-like" id="exercise-2"><h6 class="heading"> <span class="type">Demonstration</span> <span class="codenumber">2</span>.</h6> <p id="p-7">Illustrate the previous discussion with a random choice of the vector <code class="code-inline tex2jax_ignore">b</code> from the null space of <code class="code-inline tex2jax_ignore">L</code>.</p></article></div>
NL = L.right_kernel(basis='pivot') NL
%auto %html(hide=True) <div class="mathbook-content"><p id="p-8">We create an arbitrary element of the null space of <code class="code-inline tex2jax_ignore">L</code> with a linear combination.</p></div>
NLbasis = NL.basis()
b = *NLbasis[0] + *NLbasis[1] + *NLbasis[2] b
%auto %html(hide=True) <div class="mathbook-content"><p id="p-9"><code class="code-inline tex2jax_ignore">b</code> will create a consistent system with <code class="code-inline tex2jax_ignore">A</code> as coefficient matrix.</p></div>
P = A.augment(b, subdivide=True) P.rref()
%auto %html(hide=True) <div class="mathbook-content"><p id="p-10">The column space of <code class="code-inline tex2jax_ignore">A</code> is equal to the null space of <code class="code-inline tex2jax_ignore">L</code>. This is part of Theorem FS.</p></div>
CA = A.column_space() CA
%auto %html(hide=True) <div class="mathbook-content"><p id="p-11">Since the vector <code class="code-inline tex2jax_ignore">b</code> leads to a consistent system, we know it is in the column space of <code class="code-inline tex2jax_ignore">A</code>. But we can check with Sage.</p></div>
b in CA
%auto %html(hide=True) <div class="mathbook-content"><p id="p-12">Sage relies on <dfn class="terminology">echelonized bases</dfn> to represent infinite sets of vectors and to be able to test vector space equality (which seems pretty amazing at first!).</p></div>
NL.echelonized_basis()
CA == NL
%auto %html(hide=True) <div class="mathbook-content"><article class="conclusion" id="conclusion-1"><h5 class="heading"><span></span></h5></article></div>
%auto %html(hide=True) <div class="mathbook-content"><p id="p-13">This work is Copyright 2016–2019 by Robert A. Beezer. It is licensed under a <a class="external" href="https://creativecommons.org/licenses/by-sa/4.0/" target="_blank">Creative Commons Attribution-ShareAlike 4.0 International License</a>.</p></div>
%auto %html(hide=True) <div class="mathbook-content"><table width="90%" style="font-size: 200%;"><tr></tr></table></div>