Skip to content

add GT5 checkit #776

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions source/linear-algebra/exercises/bank.xml
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,14 @@
with a given eigenvalue.
</description>
</outcome>
<outcome>
<title>Change of Basis</title>
<path>outcomes/GT/GT5</path>
<slug>GT5</slug>
<description>
Calculate the change-of-basis matrix between two bases of R^n.
</description>
</outcome>
<outcome>
<title>Multiple Choice Midterm</title>
<path>outcomes/Extra/Extra1Midterm</path>
Expand Down
28 changes: 28 additions & 0 deletions source/linear-algebra/exercises/outcomes/GT/GT5/generator.sage
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
load("../../../source/common/sagemath/library.sage")
TBIL.config_matrix_typesetting()

class Generator(BaseGenerator):
def data(self):
# create a 3x3 invertible matrix
A = CheckIt.simple_random_matrix_of_rank(3,rows=3,columns=3)
new_vector = column_matrix(
vector(QQ, [randrange(1,5)*choice([-1,1]) for _ in range(3)])
)
old_vector = A*new_vector
lin_combo_exp = TBIL.LinearCombination(
[
new_vector[i]
for i in range(3)
],
[
column_matrix(A.column(i))
for i in range(3)
],
)
return {
"M_B": A^(-1),
"v": old_vector,
"lin_combo_exp": lin_combo_exp,
"vecset": TBIL.VectorSet(A.columns()),
}

34 changes: 34 additions & 0 deletions source/linear-algebra/exercises/outcomes/GT/GT5/template.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version='1.0' encoding='UTF-8'?>
<knowl mode="exercise" xmlns="https://spatext.clontz.org" version="0.2">
<intro>
<p>
Let <m>\mathcal{B}= {{vecset}}</m>, and <m>\vec{v}= {{v}}</m>.
</p>
</intro>
<knowl>
<content>
<p>
Explain and demonstrate how to verify that <m>\mathcal{B}</m> is a basis of <m>\mathbb R^3</m>
and how to calculate <m>M_\mathcal{B}</m>, the change-of-basis matrix from the standard basis of
<m>\mathbb R^3</m> to <m>\mathcal{B}</m>.
</p>
</content>
<outtro>
<p><m>M_{\mathcal B} = {{M_B}}</m></p>
</outtro>
</knowl>

<knowl>
<content>
<p>
Explain and demonstrate how to use <m>M_\mathcal{B}</m> to express <m>\vec{v}</m> in terms of
<m>\mathcal{B}</m>-basis vectors.
</p>
</content>
<outtro>
<p>
<m>{{v}} = {{lin_combo_exp}}</m>
</p>
</outtro>
</knowl>
</knowl>
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@ class Generator(BaseGenerator):
result["system"] = CheckIt.latex_system_from_matrix(m)
else:
result["vector_eq"] = TBIL.VectorEquation(m)

return result

4 changes: 4 additions & 0 deletions source/linear-algebra/source/05-GT/outcomes/05.ptx
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version='1.0' encoding='UTF-8'?>
<p>
Calculate the change-of-basis matrix between two bases of <m>\IR^n</m>.
</p>
4 changes: 2 additions & 2 deletions source/linear-algebra/source/05-GT/outcomes/main.ptx
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ By the end of this chapter, you should be able to...
<li>
<xi:include href="./04.ptx"/>
</li>
<!-- <li>
<li>
<xi:include href="./05.ptx"/>
</li> -->
</li>
</ol>
</objectives>