Skip to content

Commit b95390a

Browse files
committed
add calculations for false properties to AT5
1 parent 440738a commit b95390a

2 files changed

Lines changed: 17 additions & 34 deletions

File tree

source/linear-algebra/exercises/outcomes/AT/AT5/generator.sage

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class Generator(BaseGenerator):
1515

1616
def verify(plus,times,hardfalseproperties=[]):
1717
trueproperties={}
18-
falseproperties=hardfalseproperties
18+
falseproperties={}
1919
for prop in true_property_options:
2020
if prop == "add_assoc":
2121
LHS = plus(v1,plus(v2,v3))
@@ -38,9 +38,9 @@ class Generator(BaseGenerator):
3838
LHS = vectorsimplify(LHS)
3939
RHS = vectorsimplify(RHS)
4040
if LHS == RHS:
41-
trueproperties[prop]=vectorsimplify(LHS)
41+
trueproperties[prop]=LHS
4242
else:
43-
falseproperties.append(prop)
43+
falseproperties[prop]={"LHS": LHS, "RHS": RHS}
4444
for prop in false_only_property_options:
4545
if "dist_s" in trueproperties and "mul_id" in trueproperties:
4646
if prop == "add_id":
@@ -145,5 +145,5 @@ class Generator(BaseGenerator):
145145
"trueproperty": {
146146
trueproperty: verification
147147
},
148-
"falseproperties": {f: True for f in falseproperties},
148+
"falseproperties": falseproperties,
149149
}

source/linear-algebra/exercises/outcomes/AT/AT5/template.xml

Lines changed: 13 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -47,30 +47,6 @@ Show both sides simplify to <m>{{add_comm}}</m>.
4747
</outtro>
4848
</knowl>
4949
<!-- {{/add_comm}} -->
50-
<!-- {{#add_id}} -->
51-
<!-- <knowl>
52-
<content>
53-
<p>
54-
Show that there exists an additive identity element, that is:
55-
<me>
56-
\text{There exists }(w,z)\in V
57-
\text{ such that }(x,y)\oplus(w,z)=(x,y).
58-
</me>
59-
</p>
60-
</content>
61-
<outtro><p>TODO</p></outtro>
62-
</knowl> -->
63-
<!-- {{/add_id}} -->
64-
<!-- {{#add_inv}} -->
65-
<!-- <knowl>
66-
<content>
67-
<p>
68-
Show that additive inverses exist.
69-
</p>
70-
</content>
71-
<outtro><p>TODO</p></outtro>
72-
</knowl> -->
73-
<!-- {{/add_inv}} -->
7450
<!-- {{#mul_assoc}} -->
7551
<knowl>
7652
<content>
@@ -160,14 +136,16 @@ any one of the following properties does not hold:
160136
<!-- {{#add_assoc}} -->
161137
<item>
162138
<p>
163-
Vector addition is not associative.
139+
Vector addition is not associative: <me>(x_1,y_1)\oplus((x_2,y_2)\oplus(x_3,y_3))={{LHS}}</me>
140+
<me>((x_1,y_1)\oplus(x_2,y_2))\oplus(x_3,y_3)={{RHS}}</me>
164141
</p>
165142
</item>
166143
<!-- {{/add_assoc}} -->
167144
<!-- {{#add_comm}} -->
168145
<item>
169146
<p>
170-
Vector addition is not commutative.
147+
Vector addition is not commutative: <me>(x_1,y_1)\oplus(x_2,y_2)={{LHS}}</me>
148+
<me>(x_2,y_2)\oplus(x_1,y_1)={{RHS}}</me>
171149
</p>
172150
</item>
173151
<!-- {{/add_comm}} -->
@@ -188,28 +166,33 @@ Additive inverses do not always exist.
188166
<!-- {{#mul_assoc}} -->
189167
<item>
190168
<p>
191-
Scalar multiplication is not associative.
169+
Scalar multiplication is not associative: <me>c\odot(d\odot(x,y))={{LHS}}</me>
170+
<me>(cd)\odot(x,y)={{RHS}}</me>
192171
</p>
193172
</item>
194173
<!-- {{/mul_assoc}} -->
195174
<!-- {{#mul_id}} -->
196175
<item>
197176
<p>
198-
<m>1</m> is not a scalar multiplication identity.
177+
<m>1</m> is not a scalar multiplication identity: <me>1\odot(x,y)={{LHS}} \neq (x,y)</me>
199178
</p>
200179
</item>
201180
<!-- {{/mul_id}} -->
202181
<!-- {{#dist_v}} -->
203182
<item>
204183
<p>
205-
Scalar multiplication does not distribute over vector addition.
184+
Scalar multiplication does not distribute over vector addition:
185+
<me>c\odot((x_1,y_1)\oplus(x_2,y_2))={{LHS}}</me>
186+
<me>(c\odot(x_1,y_1))\oplus(c\odot(x_2,y_2))={{RHS}}</me>
206187
</p>
207188
</item>
208189
<!-- {{/dist_v}} -->
209190
<!-- {{#dist_s}} -->
210191
<item>
211192
<p>
212-
Scalar multiplication does not distribute over scalar addition.
193+
Scalar multiplication does not distribute over scalar addition:
194+
<me>(c+d)\odot(x,y)={{LHS}}</me>
195+
<me>(c\odot(x,y))\oplus(d\odot(x,y))={{RHS}}</me>
213196
</p>
214197
</item>
215198
<!-- {{/dist_s}} -->

0 commit comments

Comments
 (0)