Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

📚 The CoCalc Library - books, templates and other resources

132934 views
License: OTHER
Kernel:
%%html <link href="https://pretextbook.org/beta/mathbook-content.css" rel="stylesheet" type="text/css" /> <link href="https://aimath.org/mathbook/mathbook-add-on.css" rel="stylesheet" type="text/css" /> <style>.subtitle {font-size:medium; display:block}</style> <link href="https://fonts.googleapis.com/css?family=Open+Sans:400,400italic,600,600italic" rel="stylesheet" type="text/css" /> <link href="https://fonts.googleapis.com/css?family=Inconsolata:400,700&subset=latin,latin-ext" rel="stylesheet" type="text/css" /><!-- Hide this cell. --> <script> var cell = $(".container .cell").eq(0), ia = cell.find(".input_area") if (cell.find(".toggle-button").length == 0) { ia.after( $('<button class="toggle-button">Toggle hidden code</button>').click( function (){ ia.toggle() } ) ) ia.hide() } </script>

Important: to view this notebook properly you will need to execute the cell above, which assumes you have an Internet connection. It should already be selected, or place your cursor anywhere above to select. Then press the "Run" button in the menu bar above (the right-pointing arrowhead), or press Shift-Enter on your keyboard.

ParseError: KaTeX parse error: \newcommand{\lt} attempting to redefine \lt; use \renewcommand

Sage and Linear Algebra Worksheet: FCLA Section SS

Robert Beezer
Department of Mathematics and Computer Science
University of Puget Sound
Fall 2019
Section 1 Vector Spaces

It is easy in Sage to make a reasonable facsimile of Cn.\mathbf{C}^n\text{.} We just restrict our attention to rational entries rather than complex entries. This vector space contains vectors with 4 slots, each filled with a rational number.

V = QQ^4 V
Demonstration 1.

We can test membership using the word/command in. Try vectors with different numers of slots, and perhaps include the complex number 2 + 3\*I as an entry.

Section 2 Vector Form of Solutions to Homogeneous Systems

These are the coefficient matrix and vector of constants from yesterday's big system that led to a colored matrix in reduced row-echelon form.

The .right\_kernel() method will give the vectors of the vector form of the solutions to a homogeneous system when used with the basis='pivot' option.

A = matrix(QQ, [[ 1, 2, 12, 1, 13, 5, 2], [ -2, -3, -21, 0, -13, 2, -5], [ 1, 3, 15, 4, 28, 25, 0], [ -2, -3, -21, -1, -15, -6, -3], [ 1, 1, 9, 1, 4, 9, 1]]) b = vector(QQ, [8, -15, 7, -10, 3])
A.right_kernel(basis='pivot')

Rows of the “basis matrix” are vectors in yesterday's linear combination (with scalars x3,x_3\text{,} x5,x_5\text{,} x6x_6). This is a spanning set for the null space of the matrix A.A\text{.} See Theorem VFSLS and Theorem SSNS.

Theorem PSPHS can explain how to use a single solution to the non-homogeneous system and the spanning set of the null space of the coefficient matrix to arrive at all solutions to the system. Here is a single solution to the system.

A.solve_right(b)

Notice that this vector is the solution when we set each free variable to zero, which is the “other” vector from yesterday that is not part of the linear combination.

Section 3 Spanning Sets

Example ABS from FCLA.

x1 = vector(QQ,[1,1,3,1]) x2 = vector(QQ,[2,1,2,-1]) x3 = vector(QQ,[7,3,5,-5]) x4 = vector(QQ,[1,1,-1,2]) x5 = vector(QQ,[-1,0,9,0]) W = span([x1, x2, x3, x4, x5]) W
Demonstration 2.

Make a “random” linear combination of the five vectors and test for membership (which will be trivially true, repeatedly). Remember to use the \* operator for vector scalar multiplication.

But not any old vector is in W.W\text{.}

v = vector(QQ, [1, 1, -3, 2]) v in W

It should make sense that arbitrary linear combinations are in the span. How did we manufacture a vector not in the span? Stay tuned.

This work is Copyright 2016–2019 by Robert A. Beezer. It is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.