<?xml version="1.0" encoding="UTF-8"?>
<!-- Adapted from Andrey Chesnokov, ingmat3a_ntnu, section 3.8; CC BY-SA 4.0. See course-examples-provenance.json. -->
<quiz><question type="stack">
<name><text>A basis for the null space of C</text></name>
<questionvariables><text>A:matrix([1,2,3],[2,4,6]);</text></questionvariables>
<questionsimplify>1</questionsimplify>
<questiontext format="html"><text><![CDATA[<p>Give a basis for the null space of \(C={@A@}\), with one vector in each column. Any basis is accepted. Choose the number of columns yourself; use exact fractions.</p><p>[[input:ans]] [[validation:ans]] [[feedback:result]]</p>]]></text></questiontext>
<generalfeedback format="html"><text><![CDATA[Cz=0 is equivalent to z1+2*z2+3*z3=0. Every solution has the form s*(-2,1,0)+t*(-3,0,1). Any two independent vectors in this plane form a basis; they need not be these two vectors.]]></text></generalfeedback>
<defaultgrade>1</defaultgrade><penalty>0.1</penalty>
<input><name>ans</name><type>matrix</type><tans>nullspace_basis(A)</tans><boxsize>8</boxsize><strictsyntax>1</strictsyntax><insertstars>0</insertstars><forbidfloat>1</forbidfloat><checkanswertype>1</checkanswertype><mustverify>1</mustverify><showvalidation>1</showvalidation><matrix><rows initial="3" min="3" max="3" resizable="0"/><cols initial="1" min="1" max="3" resizable="1"/></matrix></input>
<prt><name>result</name><value>1</value><autosimplify>1</autosimplify><node><name>0</name><answertest>PythonChecker</answertest><sans>ans</sans><tans>A</tans><testoptions>{"checker": "basis", "options": {"space": "nullspace"}}</testoptions>
<truescoremode>=</truescoremode><truescore>1</truescore><truenextnode>-1</truenextnode><trueanswernote>basis-T</trueanswernote>
<falsescoremode>=</falsescoremode><falsescore>0</falsescore><falsenextnode>-1</falsenextnode><falseanswernote>basis-F</falseanswernote>
</node></prt>
<qtest><testcase>1</testcase><testinput><name>ans</name><value>matrix([-2,-3],[1,0],[0,1])</value></testinput><expected><name>result</name><expectedscore>1</expectedscore><expectedpenalty>0</expectedpenalty><expectedanswernote>basis-T</expectedanswernote></expected></qtest>
<qtest><testcase>2</testcase><testinput><name>ans</name><value>matrix([-3,-2],[0,1],[1,0])</value></testinput><expected><name>result</name><expectedscore>1</expectedscore><expectedpenalty>0</expectedpenalty><expectedanswernote>basis-T</expectedanswernote></expected></qtest>
<qtest><testcase>3</testcase><testinput><name>ans</name><value>matrix([-5,-1],[1,-1],[1,1])</value></testinput><expected><name>result</name><expectedscore>1</expectedscore><expectedpenalty>0</expectedpenalty><expectedanswernote>basis-T</expectedanswernote></expected></qtest>
<qtest><testcase>4</testcase><testinput><name>ans</name><value>matrix([-4,-3],[2,0],[0,1])</value></testinput><expected><name>result</name><expectedscore>1</expectedscore><expectedpenalty>0</expectedpenalty><expectedanswernote>basis-T</expectedanswernote></expected></qtest>
<qtest><testcase>5</testcase><testinput><name>ans</name><value>matrix([-2],[1],[0])</value></testinput><expected><name>result</name><expectedscore>0</expectedscore><expectedpenalty>0.1</expectedpenalty><expectedanswernote>basis-F</expectedanswernote></expected></qtest>
<qtest><testcase>6</testcase><testinput><name>ans</name><value>matrix([-2,-4],[1,2],[0,0])</value></testinput><expected><name>result</name><expectedscore>0</expectedscore><expectedpenalty>0.1</expectedpenalty><expectedanswernote>basis-F</expectedanswernote></expected></qtest>
<qtest><testcase>7</testcase><testinput><name>ans</name><value>matrix([-2,1],[1,0],[0,0])</value></testinput><expected><name>result</name><expectedscore>0</expectedscore><expectedpenalty>0.1</expectedpenalty><expectedanswernote>basis-F</expectedanswernote></expected></qtest>
<qtest><testcase>8</testcase><testinput><name>ans</name><value>matrix([-2,-3,-5],[1,0,1],[0,1,1])</value></testinput><expected><name>result</name><expectedscore>0</expectedscore><expectedpenalty>0.1</expectedpenalty><expectedanswernote>basis-F</expectedanswernote></expected></qtest>
<qtest><testcase>9</testcase><testinput><name>ans</name><value>matrix([0,0],[0,0],[0,0])</value></testinput><expected><name>result</name><expectedscore>0</expectedscore><expectedpenalty>0.1</expectedpenalty><expectedanswernote>basis-F</expectedanswernote></expected></qtest>
</question></quiz>
