Skip to content

AT4 proof of concept: dig into more than pivots #738

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 1 commit 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
91 changes: 54 additions & 37 deletions source/linear-algebra/exercises/outcomes/AT/AT4/generator.sage
Original file line number Diff line number Diff line change
Expand Up @@ -3,58 +3,75 @@ TBIL.config_matrix_typesetting()

class Generator(BaseGenerator):
def data(self):
surjective = choice([True,False])
if surjective:
rank = 4
flip = choice([True,False])
# surjection
A=CheckIt.simple_random_matrix_of_rank(4,rows=4,columns=5)
if flip:
scenario = "columns"
else:
rank = choice([2,3])
A=CheckIt.simple_random_matrix_of_rank(rank,rows=4,columns=5)

tasks = [{
"injective": False,
"surjective": surjective,
"vecset": TBIL.VectorSet(A.columns()),
scenario = "kerimg"
tasks = [{
"surj": True,
"value": True,
scenario: True,
"matrix": A,
"rref": A.rref(),
}]

injective = choice([True,False])
if injective:
rank = 3
# non surjection
A=CheckIt.simple_random_matrix_of_rank(choice([2,3]),rows=4,columns=5)
if flip:
scenario = "kerimg"
else:
rank = 2
A=CheckIt.simple_random_matrix_of_rank(rank,rows=4,columns=3)

tasks += [{
"injective": injective,
"surjective": False,
"vecset": TBIL.VectorSet(A.columns()),
scenario = "columns"
tasks += [{
"surj": True,
"value": False,
scenario: True,
"matrix": A,
"rref": A.rref(),
}]

rank = choice([2,3])
A=CheckIt.simple_random_matrix_of_rank(rank,rows=4,columns=4)

tasks += [{
"injective": False,
"surjective": False,
"vecset": TBIL.VectorSet(A.columns()),

flip = choice([True,False])
# injection
A=CheckIt.simple_random_matrix_of_rank(3,rows=4,columns=3)
if flip:
scenario = "columns"
else:
scenario = "kerimg"
tasks += [{
"inj": True,
"value": True,
scenario: True,
"matrix": A,
"rref": A.rref(),
}]

rank = 4
A=CheckIt.simple_random_matrix_of_rank(rank,rows=4,columns=4)

tasks += [{
"injective": True,
"surjective": True,
"vecset": TBIL.VectorSet(A.columns()),
# non surjection
A=CheckIt.simple_random_matrix_of_rank(2,rows=4,columns=3)
if flip:
scenario = "kerimg"
else:
scenario = "columns"
tasks += [{
"inj": True,
"value": False,
scenario: True,
"matrix": A,
"rref": A.rref(),
}]

shuffle(tasks)

return {"tasks": tasks}
flip = choice([True, False])
if flip:
rank = 4
else:
rank = choice([2,3])
A=CheckIt.simple_random_matrix_of_rank(rank,rows=4,columns=4)

return {
"tasks": tasks,
"last_value": flip,
"last_matrix": A,
"last_rref": A.rref(),
}
154 changes: 100 additions & 54 deletions source/linear-algebra/exercises/outcomes/AT/AT4/template.xml
Original file line number Diff line number Diff line change
@@ -1,32 +1,31 @@
<?xml version='1.0' encoding='UTF-8'?>
<knowl mode="exercise" xmlns="https://spatext.clontz.org" version="0.2">
<knowl>
<content>
<p>
Explain how to determine if a transformation is an injection
and/or surjection in terms of spanning and independence of a particular set.
</p>
</content>
<outtro>
<p>
Consider the set of vectors taken from the columns of
the transformation's standard matrix.
The transformation is an injection if this set (...)
and the transformation is a surjection if this set (...).
</p>
</outtro>
</knowl>
<knowl>
<intro>
<p>
Determine if the transformation defined by each of the
following standard matrices is an injection and/or surjection.
</p>
</intro>
<intro>
<p>
For each of the following standard matrices, discuss the requested property
to determine its transformation's surjectivity and/or injectivity.
</p>
</intro>
<!-- {{#tasks}} -->
<knowl>
<content>
<p><me>{{matrix}}</me></p>
<p>
Explain whether the transformation with standard matrix
<me>{{matrix}}</me> is
<!-- {{#surj}} -->
surjective
<!-- {{/surj}} -->
<!-- {{#inj}} -->
injective
<!-- {{/inj}} -->
by discussing
<!-- {{#columns}} -->
the spanning and/or independence of its column vectors.
<!-- {{/columns}} -->
<!-- {{#kerimg}} -->
its kernel and/or image.
<!-- {{/kerimg}} -->
</p>
</content>
<outtro>
<p>
Expand All @@ -35,46 +34,93 @@
</m>
</p>
<p>
The set of vectors is (...), and thus
the transformation
<!-- {{#injective}} -->
<em>is</em>
<!-- {{/injective}} -->
<!-- {{^injective}} -->
is <em>not</em>
<!-- {{/injective}} -->
injective.
</p>
<p>
The set of vectors is (...), and thus
the transformation
<!-- {{#surjective}} -->
<em>is</em>
<!-- {{/surjective}} -->
<!-- {{^surjective}} -->
is <em>not</em>
<!-- {{/surjective}} -->
surjective.
</p>
The matrix is
<!-- {{#surj}} -->
<!-- {{#value}} -->
<em>surjective</em>
<!-- {{/value}} -->
<!-- {{^value}} -->
<em>not surjective</em>
<!-- {{/value}} -->
<!-- {{/surj}} -->
<!-- {{#inj}} -->
<!-- {{#value}} -->
<em>injective</em>
<!-- {{/value}} -->
<!-- {{^value}} -->
<em>not injective</em>
<!-- {{/value}} -->
<!-- {{/inj}} -->
because
<!-- {{#columns}} -->
<!-- {{#surj}} -->
<!-- {{#value}} -->
its column vectors span the codomain.
<!-- {{/value}} -->
<!-- {{^value}} -->
its column vectors fail to span the codomain.
<!-- {{/value}} -->
<!-- {{/surj}} -->
<!-- {{#inj}} -->
<!-- {{#value}} -->
its column vectors are linearly independent.
<!-- {{/value}} -->
<!-- {{^value}} -->
its column vectors are linearly dependent.
<!-- {{/value}} -->
<!-- {{/inj}} -->
<!-- {{/columns}} -->
<!-- {{#kerimg}} -->
<!-- {{#surj}} -->
<!-- {{#value}} -->
its image is its entire codomain.
<!-- {{/value}} -->
<!-- {{^value}} -->
its image is not its entire codomain.
<!-- {{/value}} -->
<!-- {{/surj}} -->
<!-- {{#inj}} -->
<!-- {{#value}} -->
its kernel contains only the zero vector.
<!-- {{/value}} -->
<!-- {{^value}} -->
its kernel contains more than the zero vector.
<!-- {{/value}} -->
<!-- {{/inj}} -->
<!-- {{/kerimg}} -->
</p>
</outtro>
</knowl>
<!-- {{/tasks}} -->
</knowl>
<knowl>
<content>
<p>
Explain which of the above transformations was bijective.
Explain whether the transformation with standard matrix
<me>{{last_matrix}}</me> is bijective by discussing the pivots of
its reduced row echelon form.
</p>
</content>
<outtro>
<p>
<!-- {{#tasks}} -->
<!-- {{#injective}} -->
<!-- {{#surjective}} -->
The transformation with matrix <m>{{matrix}}</m> because...
<!-- {{/surjective}} -->
<!-- {{/injective}} -->
<!-- {{/tasks}} -->
<m>
\mathrm{RREF}\, {{last_matrix}} = {{last_rref}}
</m>
</p>
<p>
The transformation is
<!-- {{#last_value}} -->
<em>bijective</em>
<!-- {{/last_value}} -->
<!-- {{^last_value}} -->
<em>not bijective</em>
<!-- {{/last_value}} -->
because
<!-- {{#last_value}} -->
every row and column of its standard matrix's RREF contains a pivot.
<!-- {{/last_value}} -->
<!-- {{^last_value}} -->
it has a non-pivot row or column in its standard matrix's RREF.
<!-- {{/last_value}} -->
</p>
</outtro>
</knowl>
Expand Down