<?xml version="1.0" encoding="UTF-8"?>
<quiz>
  <question type="stack">
    <name>
      <text>16.1.3.2 Write series in summation form</text>
    </name>
    <questiontext format="html">
      <text><![CDATA[<p class="HELM_exercise">Exercise</p>
<p>Complete the summation form of the series \[ \sum_{p=1}^n = \dfrac{1}{1\times {@p_gap+1@}}+\dfrac{1}{2\times {@p_gap+2@}}+\dfrac{1}{3 \times {@p_gap+3@}}+\cdots+\dfrac{1}{{@n@}\times{@n+p_gap@}}\]below. Start by finding an expression for the typical term,
    “the \(p^{th}\) term” \(a_p\) and the determine the upper index \(n\).&nbsp;</p>
<p><span style="font-size: 0.9375rem;">\(a_p=\) [[input:ans_sum]] [[validation:ans_sum]]</span></p>
<p>\(n=\) [[input:ans_upp]] [[validation:ans_upp]]</p><br>]]></text>
    </questiontext>
    <generalfeedback format="html">
      <text><![CDATA[<p>The summation index \(p\) is set to start from \(p=1\). Hence, the typical term must be given by \(\displaystyle {@ap@}\).</p>
<p>Then, the summation is written as \[\sum_{p=1}^{@n@} {@ap@}.\]</p><br>

<p>(<b>Note:</b> the question set \(p=1\) for the first term. This is a <b>choice</b>. If you start the summation at \(p=2\), then the upper bound is {@n+1@} and the typical term must be given by \(a_p = \dfrac{1}{(p-1)({@p+p_gap-1@})}\).)</p>]]></text>
    </generalfeedback>
    <defaultgrade>1</defaultgrade>
    <penalty>0.1</penalty>
    <hidden>0</hidden>
    <idnumber/>
    <stackversion>
      <text>2020120600</text>
    </stackversion>
    <questionvariables>
      <text>/*Typical term and series length*/

p_gap: rand(3)+1;
ap: 1/(p*(p+p_gap));
n: rand([20,21,22]);</text>
    </questionvariables>
    <specificfeedback format="html">
      <text><![CDATA[<p dir="ltr" style="text-align: left;">&nbsp;[[feedback:prt_sum]]<br></p><p dir="ltr" style="text-align: left;"><br></p>]]></text>
    </specificfeedback>
    <questionnote format="moodle_auto_format">
      <text>\(a_p = \) {@ap@}, up to \(n = \) {@n@}</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>ans_sum</name>
      <type>algebraic</type>
      <tans>ap</tans>
      <boxsize>10</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>ans_upp</name>
      <type>algebraic</type>
      <tans>n</tans>
      <boxsize>2</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>prt_sum</name>
      <value>1.0000000</value>
      <autosimplify>1</autosimplify>
      <feedbackstyle>1</feedbackstyle>
      <feedbackvariables>
        <text/>
      </feedbackvariables>
      <node>
        <name>0</name>
        <description/>
        <answertest>AlgEquiv</answertest>
        <sans>ans_upp</sans>
        <tans>n</tans>
        <testoptions/>
        <quiet>0</quiet>
        <truescoremode>=</truescoremode>
        <truescore>0.5000000</truescore>
        <truepenalty/>
        <truenextnode>1</truenextnode>
        <trueanswernote>prt_sum-1-T</trueanswernote>
        <truefeedback format="html">
          <text/>
        </truefeedback>
        <falsescoremode>=</falsescoremode>
        <falsescore>0.0000000</falsescore>
        <falsepenalty/>
        <falsenextnode>1</falsenextnode>
        <falseanswernote>prt_sum-1-F</falseanswernote>
        <falsefeedback format="html">
          <text>The upper bound of the summation is incorrect.</text>
        </falsefeedback>
      </node>
      <node>
        <name>1</name>
        <description/>
        <answertest>AlgEquiv</answertest>
        <sans>ans_sum</sans>
        <tans>ap</tans>
        <testoptions/>
        <quiet>0</quiet>
        <truescoremode>+</truescoremode>
        <truescore>0.5000000</truescore>
        <truepenalty/>
        <truenextnode>-1</truenextnode>
        <trueanswernote>prt_sum-2-T</trueanswernote>
        <truefeedback format="html">
          <text/>
        </truefeedback>
        <falsescoremode>-</falsescoremode>
        <falsescore>0.0000000</falsescore>
        <falsepenalty/>
        <falsenextnode>-1</falsenextnode>
        <falseanswernote>prt_sum-2-F</falseanswernote>
        <falsefeedback format="html">
          <text><![CDATA[<p>The typical term is incorrect.</p>]]></text>
        </falsefeedback>
      </node>
    </prt>
    <deployedseed>150284174</deployedseed>
    <deployedseed>41171164</deployedseed>
    <deployedseed>245395646</deployedseed>
    <deployedseed>2086051184</deployedseed>
    <deployedseed>1560714646</deployedseed>
    <deployedseed>44878285</deployedseed>
    <deployedseed>1586580573</deployedseed>
    <qtest>
      <testcase>1</testcase>
      <description/>
      <testinput>
        <name>ans_sum</name>
        <value>ap</value>
      </testinput>
      <testinput>
        <name>ans_upp</name>
        <value>n</value>
      </testinput>
      <expected>
        <name>prt_sum</name>
        <expectedscore>1.0000000</expectedscore>
        <expectedpenalty>0.0000000</expectedpenalty>
        <expectedanswernote>prt_sum-2-T</expectedanswernote>
      </expected>
    </qtest>
    <qtest>
      <testcase>2</testcase>
      <description/>
      <testinput>
        <name>ans_sum</name>
        <value>1</value>
      </testinput>
      <testinput>
        <name>ans_upp</name>
        <value>n</value>
      </testinput>
      <expected>
        <name>prt_sum</name>
        <expectedscore>0.5000000</expectedscore>
        <expectedpenalty/>
        <expectedanswernote>prt_sum-2-F</expectedanswernote>
      </expected>
    </qtest>
    <qtest>
      <testcase>3</testcase>
      <description/>
      <testinput>
        <name>ans_sum</name>
        <value>ap</value>
      </testinput>
      <testinput>
        <name>ans_upp</name>
        <value>n+1</value>
      </testinput>
      <expected>
        <name>prt_sum</name>
        <expectedscore>0.5000000</expectedscore>
        <expectedpenalty/>
        <expectedanswernote>prt_sum-2-T</expectedanswernote>
      </expected>
    </qtest>
    <qtest>
      <testcase>4</testcase>
      <description/>
      <testinput>
        <name>ans_sum</name>
        <value>1/((p-1)*(p+p_gap-1))</value>
      </testinput>
      <testinput>
        <name>ans_upp</name>
        <value>n+1</value>
      </testinput>
      <expected>
        <name>prt_sum</name>
        <expectedscore>0.0000000</expectedscore>
        <expectedpenalty/>
        <expectedanswernote>prt_sum-2-F</expectedanswernote>
      </expected>
    </qtest>
  </question>
</quiz>
