Skip to content

Commit 8197abb

Browse files
authored
add task to GT3 to associate an eigenvector with an eigenvalue (#948)
* add task to EV3 to associate an eigenvector with an eigenvalue * add sample solution for updated GT3 * add activities
1 parent 783fd7f commit 8197abb

5 files changed

Lines changed: 122 additions & 26 deletions

File tree

source/linear-algebra/exercises/outcomes/GT/GT3/generator.sage

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,26 @@ TBIL.config_matrix_typesetting()
44
class Generator(BaseGenerator):
55
def data(self):
66
while True:
7-
ls = [choice([-1,1])*i for i in range(2,7)]
8-
l1,l2 = sample(ls,2)
9-
S=random_matrix(QQ, 2, 2, algorithm='echelonizable', rank=2, upper_bound=2)
7+
# eigenvalues will be two distinct small integers with
8+
# different absolute values
9+
l1,l2 = sample(range(2,6),2)
10+
l1,l2 = l1*choice([-1,1]),l2*choice([-1,1])
11+
S=random_matrix(QQ, 2, 2, algorithm='echelonizable', rank=2, upper_bound=6)
1012
A=S.inverse()*matrix([[l1,1],[0,l2]])*S
11-
if all(a!=0 for a in A.list()):
13+
# to get roughly consistent difficulty
14+
if all(abs(a)>5 for a in A.list()):
1215
break
1316

17+
# Get an eigenvector
18+
eigenvector = column_matrix((A-matrix([[l1,0],[0,l1]])).right_kernel(basis='pivot').basis()[0])
19+
# Scale to get whole numbers
20+
eigenvector = eigenvector[0].denominator()*eigenvector[1].denominator()*eigenvector
21+
1422
return {
1523
"matrix": A,
1624
"e1": l1,
1725
"e2": l2,
1826
"charpoly": A.charpoly('lambda_'),
27+
"eigenvector": eigenvector,
28+
"scaled_eigenvector": l1*eigenvector,
1929
}
Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,23 @@
11
<?xml version='1.0' encoding='UTF-8'?>
22
<knowl mode="exercise" xmlns="https://spatext.clontz.org" version="0.2">
3-
<content>
4-
<p>Explain and demonstrate how to find the eigenvalues of the matrix <m>{{matrix}}</m>.</p>
5-
</content>
6-
<outtro>
7-
<p>The characteristic polynomial of <m>{{matrix}}</m> is <m>{{charpoly}}</m>.</p>
8-
<p>The eigenvalues of <m>{{matrix}}</m> are <m>{{e1}}</m> and <m>{{e2}}</m>.</p>
9-
</outtro>
3+
<knowl>
4+
<content>
5+
<p>Explain and demonstrate how to find the eigenvalues of the matrix <m>{{matrix}}</m>.</p>
6+
</content>
7+
<outtro>
8+
<p>The characteristic polynomial of <m>{{matrix}}</m> is <m>{{charpoly}}</m>.</p>
9+
<p>The eigenvalues of <m>{{matrix}}</m> are <m>{{e1}}</m> and <m>{{e2}}</m>.</p>
10+
</outtro>
11+
</knowl>
12+
<knowl>
13+
<content>
14+
<p>Explain and demonstrate which of these eigenvalues is associated to the eigenvector <m>{{eigenvector}}</m>.</p>
15+
</content>
16+
<outtro>
17+
<p>
18+
<m>{{eigenvector}}</m> is associated with the eigenvalue <m>{{e1}}</m> because
19+
<me>{{matrix}}{{eigenvector}}={{scaled_eigenvector}}={{e1}}{{eigenvector}}</me>
20+
</p>
21+
</outtro>
22+
</knowl>
1023
</knowl>

source/linear-algebra/source/05-GT/03.ptx

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,19 @@ Thus the characteristic polynomial of <m>A</m> is
294294
</me>
295295
and its eigenvalues are the solutions <m>-1,6</m> to <m>\lambda^2-5\lambda-6=0</m>.
296296
</p>
297+
<p>
298+
In particular, we can see by
299+
<md>
300+
\left[\begin{array}{cc}1 &amp; 2 \\ 5 &amp; 4\end{array}\right]
301+
\left[\begin{array}{c}1 \\-1\end{array}\right]
302+
=
303+
\left[\begin{array}{c}-1 \\1\end{array}\right]
304+
=
305+
-1\left[\begin{array}{c}1 \\-1\end{array}\right]
306+
</md>
307+
that <m>\left[\begin{array}{c}1 \\-1\end{array}\right]</m> is an eigenvector
308+
associated with the eigenvalue <m>-1</m>.
309+
</p>
297310
</statement>
298311
</definition>
299312

@@ -304,14 +317,44 @@ Let <m>A = \left[\begin{array}{cc} 5 &amp; 2 \\ -3 &amp; -2 \end{array}\right]</
304317
</p>
305318
</introduction>
306319
<task>
320+
<statement>
307321
<p>
308322
Compute <m>\det (A-\lambda I)</m> to determine the characteristic polynomial of <m>A</m>.
309323
</p>
324+
</statement>
325+
<answer>
326+
<p>
327+
<m>\lambda^2-3\lambda-4</m>
328+
</p>
329+
</answer>
310330
</task>
311331
<task>
332+
<statement>
312333
<p>
313334
Set this characteristic polynomial equal to zero and factor to determine the eigenvalues of <m>A</m>.
314335
</p>
336+
</statement>
337+
<answer>
338+
<p>
339+
Solve <m>\lambda^2-3\lambda-4=(\lambda-4)(\lambda+1)=0</m>
340+
to find <m>\lambda=4,-1</m>.
341+
</p>
342+
</answer>
343+
</task>
344+
<task>
345+
<statement>
346+
<p>
347+
Use technology to calculate <m>\left[\begin{array}{cc} 5 &amp; 2 \\ -3 &amp; -2 \end{array}\right]\left[\begin{array}{c} 2 \\ -1 \end{array}\right]</m> to determine
348+
which of these eigenvalues is associated to the eigenvector <m>\left[\begin{array}{c} 2 \\ -1 \end{array}\right]</m>.
349+
</p>
350+
</statement>
351+
<answer>
352+
<p>
353+
Since
354+
<md>\left[\begin{array}{cc} 5 &amp; 2 \\ -3 &amp; -2 \end{array}\right]\left[\begin{array}{c} 2 \\ -1 \end{array}\right]=\left[\begin{array}{c} 8 \\ -4 \end{array}\right]=4\left[\begin{array}{c} 2 \\ -1 \end{array}\right]</md>
355+
the associated eigenvalue is <m>\lambda=4</m>.
356+
</p>
357+
</answer>
315358
</task>
316359
</activity>
317360

Lines changed: 45 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,51 @@
11
<?xml version='1.0' encoding='UTF-8'?>
22

3+
<example xml:id="sample-GT3">
4+
<title>GT3</title>
35

6+
<task>
7+
<statement>
8+
<p>
9+
Explain and demonstrate how to find the eigenvalues of the matrix <m>\left[\begin{array}{cc} -2 &amp; -2 \\ 10 &amp; 7 \end{array}\right] </m>.
10+
</p>
11+
</statement>
412

13+
<solution>
14+
<p>
15+
Compute the characteristic polynomial:
16+
<me>
17+
\det(A-\lambda I) = \det \left[\begin{array}{cc} -2 - \lambda &amp; -2 \\ 10 &amp; 7-\lambda \end{array}\right]
18+
</me>
19+
<me>
20+
= (-2-\lambda)(7-\lambda)+20 = \lambda ^2 -5\lambda +6 = (\lambda -2)(\lambda -3)
21+
</me>
22+
The eigenvalues are the roots of the characteristic polynomial, namely <m>2</m> and <m>3</m>.
23+
</p>
24+
</solution>
25+
</task>
526

6-
<example xml:id="sample-GT3"><title>GT3</title>
7-
<statement>
8-
<p>
9-
Explain how to find the eigenvalues of the matrix <m>\left[\begin{array}{cc} -2 &amp; -2 \\ 10 &amp; 7 \end{array}\right] </m>.
10-
</p>
11-
</statement>
12-
<solution>
13-
<p>
14-
Compute the characteristic polynomial:
15-
<me>\det(A-\lambda I) = \det \left[\begin{array}{cc} -2 - \lambda &amp; -2 \\ 10 &amp; 7-\lambda \end{array}\right]
16-
</me><me>= (-2-\lambda)(7-\lambda)+20 = \lambda ^2 -5\lambda +6 = (\lambda -2)(\lambda -3)</me>
17-
The eigenvalues are the roots of the characteristic polynomial, namely <m>2</m> and <m>3</m>.
18-
</p>
19-
</solution>
27+
28+
<task>
29+
<statement>
30+
<p>
31+
Explain and demonstrate which of these eigenvalues is associated to the eigenvector <m>\left[\begin{array}{cc} -1 \\ 2 \end{array}\right]</m>.
32+
</p>
33+
</statement>
34+
35+
<solution>
36+
<p>
37+
We can compute
38+
<md>
39+
\left[\begin{array}{cc} -2 &amp; -2 \\ 10 &amp; 7 \end{array}\right]
40+
\left[\begin{array}{cc} -1 \\ 2 \end{array}\right] =
41+
\left[\begin{array}{cc} -2 \\ 4 \end{array}\right]
42+
</md> and <md>
43+
2\left[\begin{array}{cc} -1 \\ 2 \end{array}\right] =
44+
\left[\begin{array}{cc} -2 \\ 4 \end{array}\right]
45+
</md>
46+
which shows that <m>\left[\begin{array}{cc} -1 \\ 2 \end{array}\right]</m> is an
47+
eigenvector associated with the eigenvalue <m>2</m>.
48+
</p>
49+
</solution>
50+
</task>
2051
</example>

source/linear-algebra/source/meta/sample-exercises.ptx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ for a complete solution.
2828
<xi:include href="../03-AT/samples/05.ptx"/>
2929
<xi:include href="../03-AT/samples/06.ptx"/>
3030

31-
3231
<xi:include href="../04-MX/samples/01.ptx"/>
3332
<xi:include href="../04-MX/samples/02.ptx"/>
3433
<xi:include href="../04-MX/samples/03.ptx"/>

0 commit comments

Comments
 (0)