<?xml version="1.0" encoding="UTF-8"?>
<!-- Adapted from Erasmus-CTM/math-exercise custom-special-linear-matrix; AGPL-3.0-or-later. See determinant-example-provenance.json. -->
<quiz><question type="stack">
<name><text>A nonidentity integer matrix with determinant one</text></name>
<questionvariables><text>T:matrix([1,1],[0,1]);</text></questionvariables>
<questionsimplify>1</questionsimplify>
<questiontext format="html"><text><![CDATA[<p>Enter any integer \(2\times2\) matrix \(A\ne I_2\) with \(\det(A)=1\).</p><p>[[input:ans]] [[validation:ans]]</p><p>[[feedback:integers]] [[feedback:determinant]] [[feedback:nonidentity]]</p>]]></text></questiontext>
<generalfeedback format="html"><text><![CDATA[There are three equally weighted conditions: every entry is an integer, the determinant is one, and the matrix is not the identity. For example, a shear matrix with rows (1,k) and (0,1), where k is a nonzero integer, satisfies all three.]]></text></generalfeedback>
<defaultgrade>1</defaultgrade><penalty>0.1</penalty>
<input><name>ans</name><type>matrix</type><tans>T</tans><boxsize>8</boxsize><strictsyntax>1</strictsyntax><insertstars>0</insertstars><forbidfloat>0</forbidfloat><checkanswertype>1</checkanswertype><mustverify>1</mustverify><showvalidation>1</showvalidation></input>
<prt><name>integers</name><value>1</value><autosimplify>1</autosimplify><node><name>0</name><answertest>PythonChecker</answertest><sans>ans</sans><testoptions>{"checker": "matrix_property", "options": {"property": "integer_entries"}}</testoptions><tans>true</tans>
<truescoremode>=</truescoremode><truescore>1</truescore><truenextnode>-1</truenextnode><trueanswernote>integers-T</trueanswernote>
<falsescoremode>=</falsescoremode><falsescore>0</falsescore><falsenextnode>-1</falsenextnode><falseanswernote>integers-F</falseanswernote><falsefeedback><text><![CDATA[Use integer entries.]]></text></falsefeedback>
</node></prt>
<prt><name>determinant</name><value>1</value><autosimplify>1</autosimplify><node><name>0</name><answertest>PythonChecker</answertest><sans>ans</sans><testoptions>{"checker": "matrix_property", "options": {"property": "determinant"}}</testoptions><tans>1</tans>
<truescoremode>=</truescoremode><truescore>1</truescore><truenextnode>-1</truenextnode><trueanswernote>determinant-T</trueanswernote>
<falsescoremode>=</falsescoremode><falsescore>0</falsescore><falsenextnode>-1</falsenextnode><falseanswernote>determinant-F</falseanswernote><falsefeedback><text><![CDATA[Check that ad-bc=1.]]></text></falsefeedback>
</node></prt>
<prt><name>nonidentity</name><value>1</value><autosimplify>1</autosimplify><node><name>0</name><answertest>PythonChecker</answertest><sans>ans</sans><testoptions>{"checker": "matrix_property", "options": {"property": "identity"}}</testoptions><tans>false</tans>
<truescoremode>=</truescoremode><truescore>1</truescore><truenextnode>-1</truenextnode><trueanswernote>nonidentity-T</trueanswernote>
<falsescoremode>=</falsescoremode><falsescore>0</falsescore><falsenextnode>-1</falsenextnode><falseanswernote>nonidentity-F</falseanswernote><falsefeedback><text><![CDATA[Choose a matrix different from the identity.]]></text></falsefeedback>
</node></prt>
<qtest><testcase>1</testcase><testinput><name>ans</name><value>matrix([1,1],[0,1])</value></testinput><expected><name>integers</name><expectedscore>1</expectedscore><expectedpenalty>0</expectedpenalty><expectedanswernote>integers-T</expectedanswernote></expected><expected><name>determinant</name><expectedscore>1</expectedscore><expectedpenalty>0</expectedpenalty><expectedanswernote>determinant-T</expectedanswernote></expected><expected><name>nonidentity</name><expectedscore>1</expectedscore><expectedpenalty>0</expectedpenalty><expectedanswernote>nonidentity-T</expectedanswernote></expected></qtest>
<qtest><testcase>2</testcase><testinput><name>ans</name><value>matrix([2,1],[1,1])</value></testinput><expected><name>integers</name><expectedscore>1</expectedscore><expectedpenalty>0</expectedpenalty><expectedanswernote>integers-T</expectedanswernote></expected><expected><name>determinant</name><expectedscore>1</expectedscore><expectedpenalty>0</expectedpenalty><expectedanswernote>determinant-T</expectedanswernote></expected><expected><name>nonidentity</name><expectedscore>1</expectedscore><expectedpenalty>0</expectedpenalty><expectedanswernote>nonidentity-T</expectedanswernote></expected></qtest>
<qtest><testcase>3</testcase><testinput><name>ans</name><value>matrix([0,-1],[1,0])</value></testinput><expected><name>integers</name><expectedscore>1</expectedscore><expectedpenalty>0</expectedpenalty><expectedanswernote>integers-T</expectedanswernote></expected><expected><name>determinant</name><expectedscore>1</expectedscore><expectedpenalty>0</expectedpenalty><expectedanswernote>determinant-T</expectedanswernote></expected><expected><name>nonidentity</name><expectedscore>1</expectedscore><expectedpenalty>0</expectedpenalty><expectedanswernote>nonidentity-T</expectedanswernote></expected></qtest>
<qtest><testcase>4</testcase><testinput><name>ans</name><value>matrix([1,0],[0,1])</value></testinput><expected><name>integers</name><expectedscore>1</expectedscore><expectedpenalty>0</expectedpenalty><expectedanswernote>integers-T</expectedanswernote></expected><expected><name>determinant</name><expectedscore>1</expectedscore><expectedpenalty>0</expectedpenalty><expectedanswernote>determinant-T</expectedanswernote></expected><expected><name>nonidentity</name><expectedscore>0</expectedscore><expectedpenalty>0.1</expectedpenalty><expectedanswernote>nonidentity-F</expectedanswernote></expected></qtest>
<qtest><testcase>5</testcase><testinput><name>ans</name><value>matrix([1/2,1],[0,2])</value></testinput><expected><name>integers</name><expectedscore>0</expectedscore><expectedpenalty>0.1</expectedpenalty><expectedanswernote>integers-F</expectedanswernote></expected><expected><name>determinant</name><expectedscore>1</expectedscore><expectedpenalty>0</expectedpenalty><expectedanswernote>determinant-T</expectedanswernote></expected><expected><name>nonidentity</name><expectedscore>1</expectedscore><expectedpenalty>0</expectedpenalty><expectedanswernote>nonidentity-T</expectedanswernote></expected></qtest>
<qtest><testcase>6</testcase><testinput><name>ans</name><value>matrix([2,0],[0,2])</value></testinput><expected><name>integers</name><expectedscore>1</expectedscore><expectedpenalty>0</expectedpenalty><expectedanswernote>integers-T</expectedanswernote></expected><expected><name>determinant</name><expectedscore>0</expectedscore><expectedpenalty>0.1</expectedpenalty><expectedanswernote>determinant-F</expectedanswernote></expected><expected><name>nonidentity</name><expectedscore>1</expectedscore><expectedpenalty>0</expectedpenalty><expectedanswernote>nonidentity-T</expectedanswernote></expected></qtest>
<qtest><testcase>7</testcase><testinput><name>ans</name><value>matrix([0,0],[0,0])</value></testinput><expected><name>integers</name><expectedscore>1</expectedscore><expectedpenalty>0</expectedpenalty><expectedanswernote>integers-T</expectedanswernote></expected><expected><name>determinant</name><expectedscore>0</expectedscore><expectedpenalty>0.1</expectedpenalty><expectedanswernote>determinant-F</expectedanswernote></expected><expected><name>nonidentity</name><expectedscore>1</expectedscore><expectedpenalty>0</expectedpenalty><expectedanswernote>nonidentity-T</expectedanswernote></expected></qtest>
</question></quiz>
