Skip to content
Merged
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
11 changes: 6 additions & 5 deletions source/linear-algebra/exercises/outcomes/MX/MX1/generator.sage
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,17 @@ class Generator(BaseGenerator):
productName = letters[indices.index("L")] + letters[indices.index("R")]
product = matrices[indices.index("L")] * matrices[indices.index("R")]


ordinal = randrange(product.ncols())
ordinal_string = ["first", "second", "third", "fourth"][ordinal]

return {
"A": matrices[0],
"B": matrices[1],
"C": matrices[2],
# "leftMatrix": letters[indices.index("L")],
# "rightMatrix": letters[indices.index("R")],
# "leftDim": dims[0],
# "middleDim": dims[1],
# "rightDim": dims[2],
"productName": productName,
"product": product,
"ord_value": ordinal+1,
"ordinal": ordinal_string,
"ord_col": column_matrix(product.column(ordinal)),
}
19 changes: 10 additions & 9 deletions source/linear-algebra/exercises/outcomes/MX/MX1/template.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,23 @@
</knowl>
<knowl>
<content>
<p>Find their product using technology.</p>
<p>Show how to find the {{ordinal}} column of this product without technology.</p>
</content>
<outtro>
<p>
<me>{{productName}} = {{product}}</me>
</p>
</outtro>
<outtro>
<p>
<me>
{{productName}}\vec e_{ {{ord_value}} } = {{ord_col}}
</me>
</p>
</outtro>
</knowl>
<knowl>
<content>
<p>Show how to find this product without technology.</p>
<p>Find their product using technology.</p>
</content>
<outtro>
<p>
Compute each <m>{{productName}}\vec e_i</m> to obtain
each column.
<me>{{productName}} = {{product}}</me>
</p>
</outtro>
</knowl>
Expand Down