<?xml version="1.0" encoding="UTF-8"?>
<quiz>
  <question type="stack">
    <name>
      <text>16.1.5.2 Summation forms</text>
    </name>
    <questiontext format="html">
      <text><![CDATA[<p class="HELM_exercise">Exercise</p>
<p>Write the following finite series in summation form:</p><br>
<ol class="HELM_parts">
    <li>
        <p>&nbsp;\(\displaystyle {@SA4@} =\)</p>
        <table style="margin-left: 2.5em;margin-top: 1em;">
            <tbody>
                <tr>
                    <td>[[input:ans1_upp]]</td>
                    <td>[[validation:ans1_upp]]</td>
                </tr>
                <tr>
                    <td style="text-align:center">\(\displaystyle \sum_{p ~=~ 1}\)</td>
                    <td style="vertical-align:top">[[input:ans1_sum]] [[validation:ans1_sum]]</td>
                </tr>
            </tbody>
        </table>
        <p>[[feedback:prt1]]</p>
    </li>
    <li>
        <p>&nbsp;\(\displaystyle - \frac{1}{{@simplify(1+const2)@} \times (1 + (100)^2)} +\frac{1}{{@simplify(2+const2)@} \times (1 - (200)^2)} -\frac{1}{{@simplify(3+const2)@} \times (1 + (300)^2)} + \ldots +\frac{1}{{@simplify(8+const2)@} \times (1 - (800)^2)}=\)</p>
        <table style="margin-left: 2.5em;margin-top: 1em;">
            <tbody>
                <tr>
                    <td>[[input:ans2_upp]] [[validation:ans2_upp]]</td>
                    <td></td>
                </tr>
                <tr>
                    <td style="text-align:center">\(\displaystyle \sum_{p ~=~ 1}\)</td>
                    <td style="vertical-align:top">[[input:ans2_sum]] [[validation:ans2_sum]]</td>
                </tr>
            </tbody>
        </table>
        <p>[[feedback:prt2]]</p>
    </li>
</ol>]]></text>
    </questiontext>
    <generalfeedback format="html">
      <text><![CDATA[<p>To find the summation forms of each series, we need to obtain suitable expressions for the 'typical term'. For us this is the \(p^{th}\)-term, since both series are indexed by \(p\). And \(p\) will take values \(1,\, 2,\, 3,\, \ldots,\, n\), for some
    integer \(n\) that we must also find.</p><br>
<ol class="HELM_parts">
    <li>
        <p>To find an expression for the typical term, we can look at the first three terms of the series, where \(p=1,\,2\) and \(3\), respectively. Let's start with the numerator. For \(p=1\) we have \({@num(ser1(1))@}\), for \(p=2\) we have \({@num(ser1(2))@}\),
            and for \(p=3\) we have \({@num(ser1(3))@}\). The expression \({@num(ta1)@}\) is then appropriate for the numerator of the typical term. </p>
        <p>Now, for the denominator we have \({@denom(ser1(1))@}\) for \(p=1\), \({@denom(ser1(2))@}\) for \(p=2\) and \({@denom(ser1(3))@}\) for \(p=3\). Then \({@denom(ta1)@}\) is appropriate for the denominator. </p>
        <p>Finally, to find \(n\) we look at the final term and compare it to the typical term we have found \(\displaystyle {@ta1@}\). We can see that by letting \(p={@bound1@}\) we obtain \(\displaystyle {@ser1(bound1)@}\), so \(n={@bound1@}\).</p>
        <p>Hence, the summation form of this series is \[\displaystyle \sum_{p~=~1}^{{@bound1@}} {@ta1@}\]</p>
    </li>

    <li>
        <p>Similarly, looking at the numerators for the first three terms we see that it is either \({@num(ser2(1))@}\) or \({@num(ser2(2))@}\) for odd and even values of \(p\), respectively, which can be expressed as \({@num(ta2)@}\). And looking at the
            denominators we find that they can be expressed as \({@denom(ta2)@}\).</p>

        <p>By letting \(p={@bound2@}\), in our newly found typical term \(\displaystyle {@ta2@}\) we obtain the final term \(\displaystyle {@ser2(bound2)@}\). So \(n={@bound2@}\).</p>

        <p>Hence, the summation form of this series is \[\displaystyle \sum_{p~=~1}^{{@bound2@}} {@ta2@}\]</p>
    </li>
</ol>]]></text>
    </generalfeedback>
    <defaultgrade>1</defaultgrade>
    <penalty>0.1</penalty>
    <hidden>0</hidden>
    <idnumber/>
    <stackversion>
      <text>2020120600</text>
    </stackversion>
    <questionvariables>
      <text><![CDATA[/*Randomization constants*/
const1: rand(3)+1;
const2: rand(3)+1;

/*Series 1*/
ser1: lambda([x], ev(log(ev(2*n-1,simp))/(ev(n+const1,simp)*n),n=x));
bound1:14;
ta1: ser1(p);

n_1: 3;
SA1:ev(makelist(k,k,1,n_1),simp);             /* create the sum of terms */
SA2:maplist(ser1,SA1);
SA3:append(SA2,["...",ser1(bound1)]);
SA4:apply("+",SA3);


/*Series 2*/
ser2: lambda([x], ev((-1)^x,simp) /(ev(x+const2,simp)*(1+ev((-1)^(x+1),simp)*(ev(x*100,simp))^2)));
bound2:8;
ta2: ser2(p);

n_2: 3;
SB1:ev(makelist(k,k,1,n_2),simp);             /* create the sum of terms */
SB2:maplist(ser2,SB1);
SB3:append(SB2,["...",ser2(bound2)]);
SB4:apply("+",SB3);]]></text>
    </questionvariables>
    <specificfeedback format="html">
      <text/>
    </specificfeedback>
    <questionnote format="moodle_auto_format">
      <text>\[ {@SA4@} = \sum_{p ~=~ 1}^{@bound1@} {@ta1@}\]
\[ - \frac{1}{{@simplify(1+const2)@} \times (1 + (100)^2)} +\frac{1}{{@simplify(2+const2)@} \times (1 - (200)^2)} -\frac{1}{{@simplify(3+const2)@} \times (1 + (300)^2)} + \ldots +\frac{1}{{@simplify(8+const2)@} \times (1 - (800)^2)}=  \sum_{p ~=~ 1}^{@bound2@} {@ta2@} \]</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> Your answer is partially correct.</span>]]></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>cross</multiplicationsign>
    <sqrtsign>1</sqrtsign>
    <complexno>i</complexno>
    <inversetrig>cos-1</inversetrig>
    <logicsymbol>lang</logicsymbol>
    <matrixparens>[</matrixparens>
    <isbroken>0</isbroken>
    <variantsselectionseed/>
    <input>
      <name>ans1_sum</name>
      <type>algebraic</type>
      <tans>ta1</tans>
      <boxsize>15</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>ans1_upp</name>
      <type>numerical</type>
      <tans>bound1</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>
    <input>
      <name>ans2_sum</name>
      <type>algebraic</type>
      <tans>ta2</tans>
      <boxsize>25</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>ans2_upp</name>
      <type>numerical</type>
      <tans>bound2</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>prt1</name>
      <value>1.0000000</value>
      <autosimplify>1</autosimplify>
      <feedbackstyle>1</feedbackstyle>
      <feedbackvariables>
        <text/>
      </feedbackvariables>
      <node>
        <name>0</name>
        <description/>
        <answertest>EqualComAss</answertest>
        <sans>ans1_upp</sans>
        <tans>bound1</tans>
        <testoptions/>
        <quiet>0</quiet>
        <truescoremode>=</truescoremode>
        <truescore>0.5000000</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>
      <node>
        <name>1</name>
        <description/>
        <answertest>AlgEquiv</answertest>
        <sans>ans1_sum</sans>
        <tans>ta1</tans>
        <testoptions/>
        <quiet>0</quiet>
        <truescoremode>+</truescoremode>
        <truescore>0.5000000</truescore>
        <truepenalty/>
        <truenextnode>-1</truenextnode>
        <trueanswernote>prt1-2-T</trueanswernote>
        <truefeedback format="html">
          <text/>
        </truefeedback>
        <falsescoremode>-</falsescoremode>
        <falsescore>0.0000000</falsescore>
        <falsepenalty/>
        <falsenextnode>-1</falsenextnode>
        <falseanswernote>prt1-2-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>EqualComAss</answertest>
        <sans>ans2_upp</sans>
        <tans>bound2</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>ans2_sum</sans>
        <tans>ta2</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>127247047</deployedseed>
    <deployedseed>96653900</deployedseed>
    <deployedseed>750346529</deployedseed>
    <deployedseed>80584192</deployedseed>
    <deployedseed>160189820</deployedseed>
    <deployedseed>2077717145</deployedseed>
    <deployedseed>161521659</deployedseed>
    <qtest>
      <testcase>1</testcase>
      <description/>
      <testinput>
        <name>ans1_sum</name>
        <value>ta1</value>
      </testinput>
      <testinput>
        <name>ans1_upp</name>
        <value>bound1</value>
      </testinput>
      <testinput>
        <name>ans2_sum</name>
        <value>ta2</value>
      </testinput>
      <testinput>
        <name>ans2_upp</name>
        <value>bound2</value>
      </testinput>
      <expected>
        <name>prt1</name>
        <expectedscore>1.0000000</expectedscore>
        <expectedpenalty>0.0000000</expectedpenalty>
        <expectedanswernote>prt1-2-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_sum</name>
        <value>ta2</value>
      </testinput>
      <testinput>
        <name>ans1_upp</name>
        <value>0</value>
      </testinput>
      <testinput>
        <name>ans2_sum</name>
        <value>ta1</value>
      </testinput>
      <testinput>
        <name>ans2_upp</name>
        <value>0</value>
      </testinput>
      <expected>
        <name>prt1</name>
        <expectedscore>0.0000000</expectedscore>
        <expectedpenalty/>
        <expectedanswernote>prt1-2-F</expectedanswernote>
      </expected>
      <expected>
        <name>prt2</name>
        <expectedscore>0.0000000</expectedscore>
        <expectedpenalty/>
        <expectedanswernote>prt2-2-F</expectedanswernote>
      </expected>
    </qtest>
  </question>
</quiz>
