Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

📚 The CoCalc Library - books, templates and other resources

132936 views
License: OTHER
1
<?xml version="1.0" encoding="UTF-8" ?>
2
3
<!-- Sage and Linear Algebra Worksheets -->
4
<!-- Robert A. Beezer -->
5
<!-- Copyright 2017-2019 License: CC BY-SA -->
6
<!-- See COPYING for more information -->
7
8
<pretext xmlns:xi="http://www.w3.org/2001/XInclude">
9
10
<xi:include href="../worksheetinfo.xml" />
11
12
<article xml:id="CRS">
13
<title>Sage and Linear Algebra Worksheet</title>
14
<subtitle>FCLA Section CRS</subtitle>
15
16
<!-- header inclusion needs -xinclude switch on xsltproc -->
17
<frontmatter>
18
<xi:include href="../header.xml" />
19
</frontmatter>
20
21
<section>
22
<title>Column and Row Spaces</title>
23
24
<p>This is an illustration of Theorem CSCS (and the utility of linearly independent spanning sets). <c>A</c> is a <m>5\times 7</m> matrix.</p>
25
26
<sage><input>
27
A = matrix(QQ, [[ 1, -1, -2, 0, 0, -2, 0],
28
[-4, 5, 6, -3, -1, 5, 0],
29
[-3, -2, -3, 1, -2, -2, 5],
30
[-7, 3, 3, -2, -3, 3, 5],
31
[-1, -5, -5, 4, -1, -3, 5]])
32
A
33
</input></sage>
34
35
<p>And its column space:</p>
36
37
<sage><input>
38
A.column_space()
39
</input></sage>
40
41
<p>Grab the elements of a linearly independent spanning set.</p>
42
43
<sage><input>
44
S = A.column_space().basis()
45
S
46
</input></sage>
47
48
<exercise>
49
<statement>
50
<p>Use the cells below to make a linear combination of the three vectors of the column space provided in <c>S</c>. Of course, this will also be a column space vector. As such, we can use it as the vector of constants in a linear system of equations, and the system will be guaranteed to be consistent.</p>
51
</statement>
52
</exercise>
53
54
<sage><input>
55
b = *S[0] + *S[1] + *S[2]
56
b
57
</input></sage>
58
59
<sage><input>
60
P = A.augment(b, subdivide=True)
61
P.rref()
62
</input></sage>
63
64
<sage />
65
66
<exercise>
67
<statement>
68
<p>Repeat the exercise above, but with a slight variation to produce an inconsistent system. Notice that the vectors of <c>S</c> have a nice pattern of zeros and ones in several of the entries (three to be precise). The scalars you choose for the linear combination will automatically become three entries of the vector. What about the other entries? I like to say they are <q>forced.</q> Let's wiggle one of these forced entries just a little bit. Such a vector will now leave the column space and when used as a vector of constants, will create an inconsistent system.</p>
69
</statement>
70
</exercise>
71
72
<sage><input>
73
c = *S[0] + *S[1] + *S[2]
74
c
75
</input></sage>
76
77
<sage><input>
78
d = copy(c)
79
d[4] = d[4]+1
80
d
81
</input></sage>
82
83
<sage><input>
84
P = A.augment(d, subdivide=True)
85
P.rref()
86
</input></sage>
87
88
<sage />
89
90
<p>Moral of the Story: the elements of the column space are <em>exactly</em> those vectors of constants that lead to consistent systems. It is easy, especially with a linearly independent spanning set for the column space, to make a vector of constants that yields an inconsistent system.</p>
91
</section>
92
93
<xi:include href="../legal.xml" />
94
95
</article>
96
</pretext>
97
98