<?xml version="1.0" encoding="UTF-8"?>
<quiz>
  <question type="stack">
    <name>
      <text>7.3.2.4 Compute a cofactor</text>
    </name>
    <questiontext format="html">
      <text><![CDATA[<p class="HELM_exercise">Exercise</p>
<p>Consider the matrix \(A = {@matrixa@}\). Compute the cofactors of the following entries:
</p><ol class="HELM_parts">
<li>The cofactor of \(a_{22}\) is: [[input:ans1]] [[validation:ans1]] [[feedback:prt1]]
</li><li>The cofactor of \(a_{23}\) is: [[input:ans2]] [[validation:ans2]] [[feedback:prt2]]</li></ol>]]></text>
    </questiontext>
    <generalfeedback format="html">
      <text><![CDATA[<p>We are given the matrix \(A = {@matrixa@}.\)</p>
<ol class="HELM_parts">
    <li>The minor of \(a_{22}\) is the \(2\times2\) determinant \(\begin{vmatrix}a_{11} &amp; a_{13} \\ a_{31} &amp; a_{33}\end{vmatrix}=a_{11}a_{33}-a_{31}a_{13}\). In this case, the minor is: \[\begin{vmatrix}{@AA[1,1]@} &amp; {@AA[1,3]@} \\ {@AA[3,1]@}
        &amp; {@AA[3,3]@}\end{vmatrix} = {@minorA22@} = {@ta1@}\]
        <p></p>
        <p>The sign in the position of \(a_{22}\) in the array of signs is \(+\), the cofactor of \(a_{22}\) is \(A_{22}=+{@ta1@}\).</p>
    </li>
    <li>The minor of \(a_{22}\) is the \(2\times2\) determinant \(\begin{vmatrix}a_{11} &amp; a_{12} \\ a_{31} &amp; a_{32}\end{vmatrix}=a_{11}a_{32}-a_{31}a_{12}\). In this case, the minor is: \[\begin{vmatrix}{@AA[1,1]@} &amp; {@AA[1,2]@} \\ {@AA[3,1]@}
        &amp; {@AA[3,2]@}\end{vmatrix} = {@minorA23@} = {@minorA23s@}\]
        <p></p>
        <p>
            The sign in the position of \(a_{23}\) in the array of signs is \(-\), so the cofactor of \(a_{23}\) is \(A_{23}={@cofA23@}\).
        </p>
    </li>
</ol>]]></text>
    </generalfeedback>
    <defaultgrade>1</defaultgrade>
    <penalty>0.1</penalty>
    <hidden>0</hidden>
    <idnumber/>
    <stackversion>
      <text>2021072200</text>
    </stackversion>
    <questionvariables>
      <text>matrixa: matrix([rand_with_step(-5,5,1),rand_with_step(-5,5,1),rand_with_step(-5,5,1)],[rand_with_step(-5,5,1),rand_with_step(-5,5,1),rand_with_step(-5,5,1)],[rand_with_step(-5,5,1),rand_with_step(-5,5,1),rand_with_step(-5,5,1)]);
matrixa: ev(matrixa,simp);
AA: matrixa;
ta1: ev(AA[1,1]*AA[3,3]-AA[1,3]*AA[3,1],simp);
minorA22: unary_minus_sort(AA[1,1]*AA[3,3]-AA[1,3]*AA[3,1]);
minorA23s: ev(AA[1,1]*AA[3,2]-AA[1,2]*AA[3,1],simp);
minorA23: unary_minus_sort(AA[1,1]*AA[3,2]-AA[1,2]*AA[3,1]);
cofA23 : ev(-minorA23s,simp);</text>
    </questionvariables>
    <specificfeedback format="html">
      <text/>
    </specificfeedback>
    <questionnote format="moodle_auto_format">
      <text>\(A = {@matrixa@},\quad A_{22} ={@ta1@}, \quad A_{23}= {@cofA23@}\)</text>
    </questionnote>
    <questiondescription format="moodle_auto_format">
      <text/>
    </questiondescription>
    <questionsimplify>0</questionsimplify>
    <assumepositive>0</assumepositive>
    <assumereal>0</assumereal>
    <prtcorrect format="html">
      <text><![CDATA[<span style="font-size: 1.5em; color:green;"><i class="fa fa-check"></i></span> Correct answer, well done.]]></text>
    </prtcorrect>
    <prtpartiallycorrect format="html">
      <text><![CDATA[<span style="font-size: 1.5em; color:orange;"><i class="fa fa-adjust"></i></span> Your answer is partially correct.]]></text>
    </prtpartiallycorrect>
    <prtincorrect format="html">
      <text><![CDATA[<span style="font-size: 1.5em; color:red;"><i class="fa fa-times"></i></span> Incorrect answer.]]></text>
    </prtincorrect>
    <decimals>.</decimals>
    <scientificnotation>*10</scientificnotation>
    <multiplicationsign>dot</multiplicationsign>
    <sqrtsign>1</sqrtsign>
    <complexno>i</complexno>
    <inversetrig>cos-1</inversetrig>
    <logicsymbol>lang</logicsymbol>
    <matrixparens>[</matrixparens>
    <isbroken>0</isbroken>
    <variantsselectionseed>MinorAndCofactor</variantsselectionseed>
    <input>
      <name>ans1</name>
      <type>algebraic</type>
      <tans>ta1</tans>
      <boxsize>4</boxsize>
      <strictsyntax>1</strictsyntax>
      <insertstars>0</insertstars>
      <syntaxhint/>
      <syntaxattribute>0</syntaxattribute>
      <forbidwords>determinant, minor</forbidwords>
      <allowwords/>
      <forbidfloat>1</forbidfloat>
      <requirelowestterms>0</requirelowestterms>
      <checkanswertype>0</checkanswertype>
      <mustverify>1</mustverify>
      <showvalidation>3</showvalidation>
      <options/>
    </input>
    <input>
      <name>ans2</name>
      <type>algebraic</type>
      <tans>cofA23</tans>
      <boxsize>4</boxsize>
      <strictsyntax>1</strictsyntax>
      <insertstars>0</insertstars>
      <syntaxhint/>
      <syntaxattribute>0</syntaxattribute>
      <forbidwords/>
      <allowwords/>
      <forbidfloat>1</forbidfloat>
      <requirelowestterms>0</requirelowestterms>
      <checkanswertype>0</checkanswertype>
      <mustverify>1</mustverify>
      <showvalidation>3</showvalidation>
      <options/>
    </input>
    <prt>
      <name>prt1</name>
      <value>1.0000000</value>
      <autosimplify>1</autosimplify>
      <feedbackstyle>1</feedbackstyle>
      <feedbackvariables>
        <text/>
      </feedbackvariables>
      <node>
        <name>0</name>
        <description/>
        <answertest>CasEqual</answertest>
        <sans>ans1</sans>
        <tans>ta1</tans>
        <testoptions/>
        <quiet>0</quiet>
        <truescoremode>=</truescoremode>
        <truescore>1.0000000</truescore>
        <truepenalty/>
        <truenextnode>-1</truenextnode>
        <trueanswernote>prt1-1-T</trueanswernote>
        <truefeedback format="html">
          <text/>
        </truefeedback>
        <falsescoremode>=</falsescoremode>
        <falsescore>0.0000000</falsescore>
        <falsepenalty/>
        <falsenextnode>-1</falsenextnode>
        <falseanswernote>prt1-1-F</falseanswernote>
        <falsefeedback format="html">
          <text/>
        </falsefeedback>
      </node>
    </prt>
    <prt>
      <name>prt2</name>
      <value>1.0000000</value>
      <autosimplify>1</autosimplify>
      <feedbackstyle>1</feedbackstyle>
      <feedbackvariables>
        <text/>
      </feedbackvariables>
      <node>
        <name>0</name>
        <description/>
        <answertest>AlgEquiv</answertest>
        <sans>ans2</sans>
        <tans>cofA23</tans>
        <testoptions/>
        <quiet>0</quiet>
        <truescoremode>=</truescoremode>
        <truescore>1.0000000</truescore>
        <truepenalty/>
        <truenextnode>-1</truenextnode>
        <trueanswernote>prt2-1-T</trueanswernote>
        <truefeedback format="html">
          <text/>
        </truefeedback>
        <falsescoremode>=</falsescoremode>
        <falsescore>0.0000000</falsescore>
        <falsepenalty/>
        <falsenextnode>-1</falsenextnode>
        <falseanswernote>prt2-1-F</falseanswernote>
        <falsefeedback format="html">
          <text/>
        </falsefeedback>
      </node>
    </prt>
    <deployedseed>2047965195</deployedseed>
    <deployedseed>2131635051</deployedseed>
    <deployedseed>1274060207</deployedseed>
    <deployedseed>2067862505</deployedseed>
    <deployedseed>1072463999</deployedseed>
    <deployedseed>470144349</deployedseed>
    <deployedseed>1889680758</deployedseed>
    <deployedseed>2043294690</deployedseed>
    <deployedseed>2081408866</deployedseed>
    <deployedseed>1561557479</deployedseed>
    <deployedseed>1983783838</deployedseed>
    <deployedseed>977011922</deployedseed>
    <deployedseed>860642649</deployedseed>
    <deployedseed>2108460331</deployedseed>
    <qtest>
      <testcase>1</testcase>
      <description/>
      <testinput>
        <name>ans1</name>
        <value>ta1</value>
      </testinput>
      <testinput>
        <name>ans2</name>
        <value>cofA23</value>
      </testinput>
      <expected>
        <name>prt1</name>
        <expectedscore>1.0000000</expectedscore>
        <expectedpenalty>0.0000000</expectedpenalty>
        <expectedanswernote>prt1-1-T</expectedanswernote>
      </expected>
      <expected>
        <name>prt2</name>
        <expectedscore>1.0000000</expectedscore>
        <expectedpenalty>0.0000000</expectedpenalty>
        <expectedanswernote>prt2-1-T</expectedanswernote>
      </expected>
    </qtest>
    <qtest>
      <testcase>2</testcase>
      <description/>
      <testinput>
        <name>ans1</name>
        <value>-ta1</value>
      </testinput>
      <testinput>
        <name>ans2</name>
        <value>minorA23s</value>
      </testinput>
      <expected>
        <name>prt1</name>
        <expectedscore>0.0000000</expectedscore>
        <expectedpenalty>0.1000000</expectedpenalty>
        <expectedanswernote>prt1-1-F</expectedanswernote>
      </expected>
      <expected>
        <name>prt2</name>
        <expectedscore>0.0000000</expectedscore>
        <expectedpenalty>0.1000000</expectedpenalty>
        <expectedanswernote>prt2-1-F</expectedanswernote>
      </expected>
    </qtest>
  </question>
</quiz>
