📚 The CoCalc Library - books, templates and other resources
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}{<} \newcommand{\gt}{>} \newcommand{\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="NM"></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 NM</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"><p id="p-1">First, a guaranteed nonsingular \(5\times 5\) matrix, created at random.</p></div>
A = random_matrix(QQ, 5, algorithm="unimodular", upper_bound=20) A
%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-2">Augment with the zero vector, using the matrix method <code class="code-inline tex2jax_ignore">.augment()</code> and the vector constructor <code class="code-inline tex2jax_ignore">zero_vector(QQ, 5)</code>. Then row-reduce to use Definition NM. Or instead, do not augment and apply Theorem NMRRI.</p></article></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-3">Build some random vectors with <code class="code-inline tex2jax_ignore">random_vector(QQ, 5)</code>, augment the matrix and row-reduce. There will always be a unique solution to the linear system represented by the augmented matrix. This is Theorem NMUS.</p></article></div>
%auto %html(hide=True) <div class="mathbook-content"><p id="p-4">Instead—cheap, easy and powerful:</p></div>
A.is_singular()
%auto %html(hide=True) <div class="mathbook-content"><p id="p-5">Now, a carefully crafted singular matrix.</p></div>
B = matrix(QQ, [[ 7, -1, -12, 21, -8], [-3, 3, 0, -9, 6], [ 3, 3, -12, 9, 0], [ 2, 3, -10, 6, 1], [-2, 2, 0, -6, 4]]) B
%auto %html(hide=True) <div class="mathbook-content"><article class="exercise-like" id="exercise-3"><h6 class="heading"> <span class="type">Demonstration</span> <span class="codenumber">3</span>.</h6> <p id="p-6">Augment with the zero vector and row-reduce (Definition NM), or don't augment and row-reduce (Theorem NMRRI).]</p></article></div>
%auto %html(hide=True) <div class="mathbook-content"><article class="exercise-like" id="exercise-4"><h6 class="heading"> <span class="type">Demonstration</span> <span class="codenumber">4</span>.</h6> <p id="p-7">A random vector of constants will only rarely build a consistent system when paired with <code class="code-inline tex2jax_ignore">B</code>. Try it. But this is not a theorem, see the vector <code class="code-inline tex2jax_ignore">c</code> below.</p></article></div>
%auto %html(hide=True) <div class="mathbook-content"><p id="p-8">Instead—cheap, easy and powerful:</p></div>
B.is_singular()
%auto %html(hide=True) <div class="mathbook-content"><p id="p-9">Two carefully crafted vectors for linear systems with <code class="code-inline tex2jax_ignore">B</code> as coefficient matrix.</p></div>
c = vector(QQ, [17,-15,-3,-5,-10]) d = vector(QQ, [-3,1,-2,1,2])
%auto %html(hide=True) <div class="mathbook-content"><article class="exercise-like" id="exercise-5"><h6 class="heading"> <span class="type">Demonstration</span> <span class="codenumber">5</span>.</h6> <p id="p-10">Which of these two column vectors will create a consistent system for this singular coefficient matrix? (Stay tuned.)</p></article></div>
%auto %html(hide=True) <div class="mathbook-content"><p id="p-11">A null space is called a <dfn class="terminology">right kernel</dfn> in Sage. It's description contains a lot of things we do not understand yet.</p></div>
NS = B.right_kernel() NS
%auto %html(hide=True) <div class="mathbook-content"><article class="exercise-like" id="exercise-6"><h6 class="heading"> <span class="type">Demonstration</span> <span class="codenumber">6</span>.</h6> <p id="p-12">But we can test membership in the null space, which is the most basic property of a set. Try <code class="code-inline tex2jax_ignore">u in NS</code> and then repeat with <code class="code-inline tex2jax_ignore">v</code>.</p></article></div>
u = vector(QQ, [0,0,3,4,6])
v = vector(QQ, [1,0,0,5,-2])
%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>