<?xml version="1.0" encoding="UTF-8"?>
<quiz>
  <question type="stack">
    <name>
      <text>PT.8.8 (GP Evaluate partial sum)</text>
    </name>
    <questiontext format="html">
      <text><![CDATA[<p>Find the exact value of \( \displaystyle\sum_{k=1}^{@n@} {@a@}\left({@r@}\right)^{k-1}\).</p>
<p>[[input:ans1]] [[validation:ans1]]</p>]]></text>
    </questiontext>
    <generalfeedback format="html">
      <text><![CDATA[<p>The terms come from a geometric sequence with first term \(a={@a@}\) and common ratio \(r={@r@}\).</p><p>The sum to \(n\) terms is given by \(\frac{a(1-r^n)}{1-r}\), so applying this with \(n={@n@}\) we find the sum is {@ta@}.</p>]]></text>
    </generalfeedback>
    <defaultgrade>1</defaultgrade>
    <penalty>0.1</penalty>
    <hidden>0</hidden>
    <idnumber/>
    <stackversion>
      <text>2020081700</text>
    </stackversion>
    <questionvariables>
      <text>r:rand([1,-1])*rand([1/5, 1/4, 1/3, 2/5, 1/2, 3/5, 2/3, 3/4, 4/5]);
a:rand([2,3,4,5,6]);/* rand_with_prohib(-6,6,[-1,0,1]); */
n:rand([5,6]);
ta:sum(a*r^(k-1),k,1,n)</text>
    </questionvariables>
    <specificfeedback format="html">
      <text>[[feedback:prt1]]</text>
    </specificfeedback>
    <questionnote format="moodle_auto_format">
      <text>\( \displaystyle\sum_{k=1}^{@n@} {@a@}\left({@r@}\right)^{k-1}={@ta@}\)</text>
    </questionnote>
    <questiondescription format="moodle_auto_format">
      <text/>
    </questiondescription>
    <questionsimplify>1</questionsimplify>
    <assumepositive>0</assumepositive>
    <assumereal>0</assumereal>
    <prtcorrect format="html">
      <text>Correct answer, well done.</text>
    </prtcorrect>
    <prtpartiallycorrect format="html">
      <text>Your answer is partially correct.</text>
    </prtpartiallycorrect>
    <prtincorrect format="html">
      <text>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>ta</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>1</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>ta</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>
    <deployedseed>1471617068</deployedseed>
    <deployedseed>483156680</deployedseed>
    <deployedseed>388924992</deployedseed>
    <deployedseed>1513572249</deployedseed>
    <deployedseed>227466867</deployedseed>
    <deployedseed>1719693384</deployedseed>
    <deployedseed>1756845804</deployedseed>
    <deployedseed>12382786</deployedseed>
    <deployedseed>406688188</deployedseed>
    <deployedseed>1305166405</deployedseed>
    <deployedseed>1026311540</deployedseed>
    <deployedseed>988558983</deployedseed>
    <deployedseed>943400101</deployedseed>
    <deployedseed>1048702374</deployedseed>
    <deployedseed>1745595535</deployedseed>
    <deployedseed>855797842</deployedseed>
    <deployedseed>1135403061</deployedseed>
    <deployedseed>1579709953</deployedseed>
    <deployedseed>1679626419</deployedseed>
    <deployedseed>1906707820</deployedseed>
    <deployedseed>1904715343</deployedseed>
    <deployedseed>81901971</deployedseed>
    <deployedseed>1505914883</deployedseed>
    <deployedseed>710339021</deployedseed>
    <deployedseed>1761614101</deployedseed>
    <deployedseed>793993629</deployedseed>
    <deployedseed>2095495563</deployedseed>
    <deployedseed>1916079487</deployedseed>
    <deployedseed>278857024</deployedseed>
    <deployedseed>1297373765</deployedseed>
    <qtest>
      <testcase>1</testcase>
      <description/>
      <testinput>
        <name>ans1</name>
        <value>ta</value>
      </testinput>
      <expected>
        <name>prt1</name>
        <expectedscore>1.0000000</expectedscore>
        <expectedpenalty>0.0000000</expectedpenalty>
        <expectedanswernote>prt1-1-T</expectedanswernote>
      </expected>
    </qtest>
  </question>
</quiz>
