<?xml version="1.0" encoding="UTF-8"?>
<quiz>
  <question type="stack">
    <name>
      <text>PT.7.1 (Matrix multiplication defined)</text>
    </name>
    <questiontext format="moodle_auto_format">
      <text><![CDATA[<p>Suppose we have two matrices \(A\) and \(B\) which have sizes \({@m1@} \times {@n1@}\) and \(n \times {@p2@}\). What value does \(n\) have to take in order for the multiplication to be defined? What would be the size of the resulting matrix?</p>
<p> n =[[input:ans1]] [[validation:ans1]][[feedback:prt1]]</p>
<p>Size = [[input:ans21]] [[validation:ans21]] \(\times\) [[input:ans22]] [[validation:ans22]] [[feedback:prt2]]</p>]]></text>
    </questiontext>
    <generalfeedback format="moodle_auto_format">
      <text><![CDATA[<p>Recall that we can only perform a matrix multiplication if the number of columns of the first matrix equal the number of rows of the second. Multiplying a  \(m \times n\) matrix by a \(n \times p\) matrix results in a matrix of size \(m \times p\). Hence in this case we have 
\[
n = {@ta1@} \qquad \mbox{and the resulting matrix is of dimension } {@ta21@} \times {@ta22@}
\]</p>]]></text>
    </generalfeedback>
    <defaultgrade>1</defaultgrade>
    <penalty>0.1</penalty>
    <hidden>0</hidden>
    <idnumber/>
    <stackversion>
      <text>2020081700</text>
    </stackversion>
    <questionvariables>
      <text>m1: 1+ rand(10);
n1: 1+rand(10);
p2:  1+rand(20);

ta1:n1;
ta21: m1;
ta22:p2;</text>
    </questionvariables>
    <specificfeedback format="html">
      <text/>
    </specificfeedback>
    <questionnote format="moodle_auto_format">
      <text>\(({@m1@} \times {@n1@}) \times ({@ta1@} \times {@p2@}) = ({@ta21@} \times {@ta22@}) \)</text>
    </questionnote>
    <questiondescription format="moodle_auto_format">
      <text/>
    </questiondescription>
    <questionsimplify>1</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/>
    <input>
      <name>ans1</name>
      <type>algebraic</type>
      <tans>ta1</tans>
      <boxsize>5</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>
    <input>
      <name>ans21</name>
      <type>algebraic</type>
      <tans>ta21</tans>
      <boxsize>5</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>
    <input>
      <name>ans22</name>
      <type>algebraic</type>
      <tans>ta22</tans>
      <boxsize>5</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>AlgEquiv</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>ans21</sans>
        <tans>ta21</tans>
        <testoptions/>
        <quiet>0</quiet>
        <truescoremode>=</truescoremode>
        <truescore>0.5000000</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>
      <node>
        <name>1</name>
        <description/>
        <answertest>AlgEquiv</answertest>
        <sans>ans22</sans>
        <tans>ta22</tans>
        <testoptions/>
        <quiet>0</quiet>
        <truescoremode>+</truescoremode>
        <truescore>0.5000000</truescore>
        <truepenalty/>
        <truenextnode>-1</truenextnode>
        <trueanswernote>prt2-2-T</trueanswernote>
        <truefeedback format="html">
          <text/>
        </truefeedback>
        <falsescoremode>-</falsescoremode>
        <falsescore>0.0000000</falsescore>
        <falsepenalty/>
        <falsenextnode>-1</falsenextnode>
        <falseanswernote>prt2-2-F</falseanswernote>
        <falsefeedback format="html">
          <text/>
        </falsefeedback>
      </node>
    </prt>
    <deployedseed>1313329541</deployedseed>
    <deployedseed>373172088</deployedseed>
    <deployedseed>1569232502</deployedseed>
    <deployedseed>821878042</deployedseed>
    <deployedseed>1834983749</deployedseed>
    <deployedseed>33539225</deployedseed>
    <deployedseed>524871793</deployedseed>
    <deployedseed>1517322062</deployedseed>
    <deployedseed>1781124459</deployedseed>
    <deployedseed>1599683472</deployedseed>
    <deployedseed>2038163174</deployedseed>
    <deployedseed>1238478461</deployedseed>
    <deployedseed>1511223604</deployedseed>
    <deployedseed>892807522</deployedseed>
    <deployedseed>1339913532</deployedseed>
    <deployedseed>1607720284</deployedseed>
    <deployedseed>723869484</deployedseed>
    <deployedseed>772610889</deployedseed>
    <deployedseed>2072660424</deployedseed>
    <deployedseed>1458823846</deployedseed>
    <deployedseed>1727146835</deployedseed>
    <deployedseed>491824027</deployedseed>
    <deployedseed>1809017936</deployedseed>
    <deployedseed>1766235778</deployedseed>
    <deployedseed>370385754</deployedseed>
    <deployedseed>166151589</deployedseed>
    <deployedseed>1026023961</deployedseed>
    <deployedseed>1980087260</deployedseed>
    <deployedseed>1883140405</deployedseed>
    <deployedseed>1533015153</deployedseed>
    <deployedseed>274771925</deployedseed>
    <deployedseed>989539879</deployedseed>
    <deployedseed>538848296</deployedseed>
    <deployedseed>1064842097</deployedseed>
    <deployedseed>535639299</deployedseed>
    <deployedseed>1925663648</deployedseed>
    <deployedseed>1527172005</deployedseed>
    <deployedseed>138857975</deployedseed>
    <deployedseed>105025423</deployedseed>
    <deployedseed>739503719</deployedseed>
    <deployedseed>1709693087</deployedseed>
    <deployedseed>763502898</deployedseed>
    <deployedseed>1237177560</deployedseed>
    <deployedseed>102137269</deployedseed>
    <deployedseed>171482480</deployedseed>
    <deployedseed>1924184507</deployedseed>
    <deployedseed>1693623371</deployedseed>
    <deployedseed>1513898634</deployedseed>
    <deployedseed>1260137581</deployedseed>
    <deployedseed>928695053</deployedseed>
    <qtest>
      <testcase>1</testcase>
      <description/>
      <testinput>
        <name>ans1</name>
        <value>ta1</value>
      </testinput>
      <testinput>
        <name>ans21</name>
        <value>ta21</value>
      </testinput>
      <testinput>
        <name>ans22</name>
        <value>ta22</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-2-T</expectedanswernote>
      </expected>
    </qtest>
    <qtest>
      <testcase>2</testcase>
      <description/>
      <testinput>
        <name>ans1</name>
        <value>ta1-1</value>
      </testinput>
      <testinput>
        <name>ans21</name>
        <value>ta21-1</value>
      </testinput>
      <testinput>
        <name>ans22</name>
        <value>ta22-1</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-2-F</expectedanswernote>
      </expected>
    </qtest>
  </question>
</quiz>
