<?xml version="1.0" encoding="UTF-8"?>
<quiz>
  <question type="stack">
    <name>
      <text>4.4.10 (Log scales from graph info)</text>
    </name>
    <questiontext format="moodle_auto_format">
      <text><![CDATA[<p>Suppose that the relationship between variables \(x\) and \(y\) is given by \(y = ab^x\) where \(a\) and \(b\) are positive constants. An experiment to test that the  follow this relationship was plotted on a log-scaled graph of \(x\) against \(Y = \ln(y)\). Given that the points \((0,{@py1@})\) and \(({@px2@},{@py2@})\) lie on the line in the graph find the values of \(a\) and \(b\).</p>


<p>\(a=\)[[input:ans1]] [[validation:ans1]]</p>
<p>\(b=\)[[input:ans2]] [[validation:ans2]]</p>]]></text>
    </questiontext>
    <generalfeedback format="moodle_auto_format">
      <text><![CDATA[<p>Since we are old that \(x\) is plotted against \(Y= \ln(y)\) we know that the data follow a straight line. Therefore we need to obtain a straight line equation from \(y = ab^x\). So taking logs as before and using the log laws to simplify we obtain.
\[
\begin{align*} 
\ln(y) &amp;= \ln(ab^x) 
\\ 
&amp;= \ln(a) + x\ln(b)
\\
&= Y = (\ln(b))x + \ln(a).
\end{align*} 
\] 
Since this is now an equation of a straight line we need to find the \(y\)-intercept and the gradient. Happily we are told that \((0,{@py1@})\) and \(({@px2@},{@py2@})\) lies on the line so the y-intercept is \({@py1@}\). therefore \(ln(a) = {@py1@}\) and thus \(a = {@ta1@}\).</p>
<p>We can find the gradient as follows
\[
\ln(b) = \frac{{@py2@}-{@py1@}}{{@px2@}-0} = {@grad@}
\]
Hence, \(b = {@ta2@}\) and the equation of the line is \(Y = {@ta2@}x + {@ta1@}\).</p>]]></text>
    </generalfeedback>
    <defaultgrade>1</defaultgrade>
    <penalty>0.1</penalty>
    <hidden>0</hidden>
    <idnumber/>
    <stackversion>
      <text>2020081700</text>
    </stackversion>
    <questionvariables>
      <text>py1: 1+ rand(10);
px2: 1+ rand(10);
py2: 1+ rand(10);

ta1: exp(py1);

grad: (py2-py1)/px2;
ta2: exp(grad);</text>
    </questionvariables>
    <specificfeedback format="html">
      <text>[[feedback:prt1]]</text>
    </specificfeedback>
    <questionnote format="moodle_auto_format">
      <text>\(Y = {@ta2@}x + {@ta1@}\)</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>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>ans2</name>
      <type>algebraic</type>
      <tans>ta2</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>
    <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>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>ans2</sans>
        <tans>ta2</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>
    <deployedseed>1870137072</deployedseed>
    <deployedseed>782507140</deployedseed>
    <deployedseed>1559483241</deployedseed>
    <deployedseed>606330954</deployedseed>
    <deployedseed>483067941</deployedseed>
    <deployedseed>937676421</deployedseed>
    <deployedseed>783123728</deployedseed>
    <deployedseed>1810814743</deployedseed>
    <deployedseed>1977324118</deployedseed>
    <deployedseed>1924694125</deployedseed>
    <deployedseed>1410843614</deployedseed>
    <deployedseed>1495992814</deployedseed>
    <deployedseed>184612274</deployedseed>
    <deployedseed>1861802646</deployedseed>
    <deployedseed>1822671957</deployedseed>
    <deployedseed>460145615</deployedseed>
    <deployedseed>1403237583</deployedseed>
    <deployedseed>1591994349</deployedseed>
    <deployedseed>1558820896</deployedseed>
    <deployedseed>1281236366</deployedseed>
    <deployedseed>1566896847</deployedseed>
    <deployedseed>1815344309</deployedseed>
    <deployedseed>1154676170</deployedseed>
    <deployedseed>1431069911</deployedseed>
    <deployedseed>144387844</deployedseed>
    <deployedseed>419108002</deployedseed>
    <deployedseed>751664184</deployedseed>
    <deployedseed>548317262</deployedseed>
    <deployedseed>2060050026</deployedseed>
    <deployedseed>909472244</deployedseed>
    <deployedseed>349793751</deployedseed>
    <deployedseed>1170730176</deployedseed>
    <deployedseed>922893729</deployedseed>
    <deployedseed>831027733</deployedseed>
    <deployedseed>686001960</deployedseed>
    <deployedseed>391822410</deployedseed>
    <deployedseed>551201378</deployedseed>
    <deployedseed>839310152</deployedseed>
    <deployedseed>1689316655</deployedseed>
    <deployedseed>539398713</deployedseed>
    <deployedseed>118683144</deployedseed>
    <deployedseed>261788401</deployedseed>
    <deployedseed>1018357566</deployedseed>
    <deployedseed>562109307</deployedseed>
    <deployedseed>1970775926</deployedseed>
    <deployedseed>225023914</deployedseed>
    <deployedseed>81024050</deployedseed>
    <deployedseed>2114972724</deployedseed>
    <deployedseed>543758724</deployedseed>
    <deployedseed>810556803</deployedseed>
    <qtest>
      <testcase>1</testcase>
      <description/>
      <testinput>
        <name>ans1</name>
        <value>ta1</value>
      </testinput>
      <testinput>
        <name>ans2</name>
        <value>ta2</value>
      </testinput>
      <expected>
        <name>prt1</name>
        <expectedscore>1.0000000</expectedscore>
        <expectedpenalty>0.0000000</expectedpenalty>
        <expectedanswernote>prt1-2-T</expectedanswernote>
      </expected>
    </qtest>
    <qtest>
      <testcase>2</testcase>
      <description/>
      <testinput>
        <name>ans1</name>
        <value>ta1-1</value>
      </testinput>
      <testinput>
        <name>ans2</name>
        <value>ta2</value>
      </testinput>
      <expected>
        <name>prt1</name>
        <expectedscore>0.5000000</expectedscore>
        <expectedpenalty>0.1000000</expectedpenalty>
        <expectedanswernote>prt1-2-T</expectedanswernote>
      </expected>
    </qtest>
    <qtest>
      <testcase>3</testcase>
      <description/>
      <testinput>
        <name>ans1</name>
        <value>ta1</value>
      </testinput>
      <testinput>
        <name>ans2</name>
        <value>ta2-1</value>
      </testinput>
      <expected>
        <name>prt1</name>
        <expectedscore>0.5000000</expectedscore>
        <expectedpenalty>0.1000000</expectedpenalty>
        <expectedanswernote>prt1-2-F</expectedanswernote>
      </expected>
    </qtest>
  </question>
</quiz>
