<?xml version="1.0" encoding="UTF-8"?>
<quiz>
  <question type="stack">
    <name>
      <text>8.2.9 (Which are correct sigma notation for this sum?)</text>
    </name>
    <questiontext format="html">
      <text><![CDATA[<p class="noindent">Which of the following are correct sigma notation for the sum {@(apply("+",terms)),simp=false@}?</p>  
 [[input:ans1]] [[validation:ans1]]]]></text>
    </questiontext>
    <generalfeedback format="html">
      <text><![CDATA[<p class="noindent">All the options seem to use the right general form (something like {@expr@}), so we just need to check that the upper and lower limits are correct.</p><p class="noindent">The following are all correct representations, and there are many more:</p><p class="noindent">\[ {@cor1@}\quad{@cor2@}\quad{@cor3@}\quad{@cor4@} \]</p><p></p>]]></text>
    </generalfeedback>
    <defaultgrade>1</defaultgrade>
    <penalty>0.1</penalty>
    <hidden>0</hidden>
    <idnumber/>
    <stackversion>
      <text>2022082900</text>
    </stackversion>
    <questionvariables>
      <text>lower:0+rand(5)
upper:lower+4+rand(3)
expr:rand([rand([1,2,3,4])*n,n-1,n^2,(n-1)^2])
terms:makelist(ev(expr,n=n),n,lower,upper);
simp:false;
cor1:'sum(expr,n,lower,upper);
cor2:'sum(ev(expr,n=k-1,simp),k,ev(lower+1,simp),ev(upper+1,simp));
cor3:'sum(ev(expr,n=j+1,simp),j,ev(lower-1,simp),ev(upper-1,simp));
cor4:'sum(ev(expr,n=m,simp),m,ev(lower,simp),ev(upper,simp));
incor1:'sum(ev(expr,n=k-1,simp),k,ev(lower,simp),ev(upper,simp));
incor2:'sum(ev(expr,n=k-1,simp),k,ev(lower+1,simp),ev(upper,simp));
incor3:'sum(ev(expr,n=j+1,simp),j,ev(lower+1,simp),ev(upper+1,simp));
incor4:'sum(ev(expr,n=m+1,simp),m,ev(lower,simp),ev(upper,simp));
corbase:[cor1,cor2,cor3,cor4];
wrongbase:[incor1,incor2,incor3,incor4];
mcq:multiselqnalpha(corbase, 3, wrongbase, 3);
ta1:mcq[1];
version:mcq[2];
corr1:mcq_correct(ta1);
incorr1:mcq_incorrect(ta1);</text>
    </questionvariables>
    <specificfeedback format="html">
      <text>[[feedback:prt1]]</text>
    </specificfeedback>
    <questionnote format="moodle_auto_format">
      <text>{#version#}</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>none</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>checkbox</type>
      <tans>ta1</tans>
      <boxsize>15</boxsize>
      <strictsyntax>1</strictsyntax>
      <insertstars>0</insertstars>
      <syntaxhint/>
      <syntaxattribute>0</syntaxattribute>
      <forbidwords/>
      <allowwords/>
      <forbidfloat>1</forbidfloat>
      <requirelowestterms>1</requirelowestterms>
      <checkanswertype>1</checkanswertype>
      <mustverify>0</mustverify>
      <showvalidation>0</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>setify(ans1)</sans>
        <tans>setify(corr1)</tans>
        <testoptions/>
        <quiet>0</quiet>
        <truescoremode>=</truescoremode>
        <truescore>1</truescore>
        <truepenalty>0</truepenalty>
        <truenextnode>-1</truenextnode>
        <trueanswernote>prt1-0-T</trueanswernote>
        <truefeedback format="html">
          <text/>
        </truefeedback>
        <falsescoremode>=</falsescoremode>
        <falsescore>0</falsescore>
        <falsepenalty>0.1</falsepenalty>
        <falsenextnode>-1</falsenextnode>
        <falseanswernote>prt1-0-F</falseanswernote>
        <falsefeedback format="html">
          <text/>
        </falsefeedback>
      </node>
    </prt>
    <deployedseed>867540392</deployedseed>
    <deployedseed>440539196</deployedseed>
    <deployedseed>1211455718</deployedseed>
    <deployedseed>1264315942</deployedseed>
    <deployedseed>1518053500</deployedseed>
    <deployedseed>1880802815</deployedseed>
    <deployedseed>1547010587</deployedseed>
    <deployedseed>956518850</deployedseed>
    <deployedseed>1238038742</deployedseed>
    <deployedseed>934871550</deployedseed>
    <deployedseed>517131983</deployedseed>
    <deployedseed>46764854</deployedseed>
    <deployedseed>1216565610</deployedseed>
    <deployedseed>1021768071</deployedseed>
    <deployedseed>1712322395</deployedseed>
    <deployedseed>1365073673</deployedseed>
    <deployedseed>1629195480</deployedseed>
    <deployedseed>683626979</deployedseed>
    <deployedseed>791788739</deployedseed>
    <deployedseed>173575521</deployedseed>
    <deployedseed>953051383</deployedseed>
    <deployedseed>1524797822</deployedseed>
    <deployedseed>2016182349</deployedseed>
    <deployedseed>105994747</deployedseed>
    <deployedseed>1787160112</deployedseed>
    <qtest>
      <testcase>1</testcase>
      <description/>
      <testinput>
        <name>ans1</name>
        <value>corr1</value>
      </testinput>
      <expected>
        <name>prt1</name>
        <expectedscore>1.0000000</expectedscore>
        <expectedpenalty>0.0000000</expectedpenalty>
        <expectedanswernote>prt1-0-T</expectedanswernote>
      </expected>
    </qtest>
    <qtest>
      <testcase>2</testcase>
      <description/>
      <testinput>
        <name>ans1</name>
        <value>incorr1</value>
      </testinput>
      <expected>
        <name>prt1</name>
        <expectedscore>0.0000000</expectedscore>
        <expectedpenalty>0.1000000</expectedpenalty>
        <expectedanswernote>prt1-0-F</expectedanswernote>
      </expected>
    </qtest>
    <qtest>
      <testcase>3</testcase>
      <description/>
      <testinput>
        <name>ans1</name>
        <value>sort([incorr1[1],corr1[1]])</value>
      </testinput>
      <expected>
        <name>prt1</name>
        <expectedscore>0.0000000</expectedscore>
        <expectedpenalty>0.1000000</expectedpenalty>
        <expectedanswernote>prt1-0-F</expectedanswernote>
      </expected>
    </qtest>
    <qtest>
      <testcase>4</testcase>
      <description/>
      <testinput>
        <name>ans1</name>
        <value>[corr1[1]]</value>
      </testinput>
      <expected>
        <name>prt1</name>
        <expectedscore>0.0000000</expectedscore>
        <expectedpenalty>0.1000000</expectedpenalty>
        <expectedanswernote>prt1-0-F</expectedanswernote>
      </expected>
    </qtest>
  </question>
</quiz>
