<?xml version="1.0" encoding="UTF-8"?>
<quiz>
  <question type="stack">
    <name>
      <text>18.4.3.2 Approximate percentage relative error</text>
    </name>
    <questiontext format="html">
      <text><![CDATA[<p class="HELM_exercise">Exercise</p>
<p>If \(\displaystyle f={@f@}\) and \(x, y, u\) are subject to percentage relative errors of \({@error_x@}\)%, \({@error_y@}\)% and \({@error_u@}\)% respectively, find the approximate percentage relative error in \(f\).</p>
<p><br></p>
<p>First, find \(\dfrac{\partial f}{\partial x}, \dfrac{\partial f}{\partial y}\) and \(\dfrac{\partial f}{\partial u}:\)</p>
<p>\(\dfrac{\partial f}{\partial x} = \) [[input:ans1]] [[validation:ans1]]</p>
<p>\(\dfrac{\partial f}{\partial y} = \) [[input:ans2]] [[validation:ans2]]</p>
<p>\(\dfrac{\partial f}{\partial u} = \) [[input:ans3]] [[validation:ans3]]</p>
<p>[[feedback:prt1]] [[feedback:prt2]] [[feedback:prt3]]</p>
<p><br></p>
<p>Now write down an expression for the percentage relative error in \(f\):</p>
<p>\(\dfrac{\delta f}{f} \times 100 \simeq \) [[input:ans4]] [[validation:ans4]]\(\dfrac{\delta x}{x} \times 100 +\)&nbsp; [[input:ans5]] [[validation:ans5]] \(\dfrac{\delta y}{y} \times 100 - \) [[input:ans6]] [[validation:ans6]] \(\dfrac{\delta u}{u} \times
    100\) </p>
<p>[[feedback:prt4]] [[feedback:prt5]] [[feedback:prt6]]</p>
<p><br></p>
<p>Inputting the the percentage relative errors of \({@error_x@}\)%, \({@error_y@}\)%, \({@error_u@}\)% in \(x,y,u\), the value of the percentage relative error is [[input:ans7]] [[validation:ans7]] %.</p>
<p> [[feedback:prt7]]</p>]]></text>
    </questiontext>
    <generalfeedback format="html">
      <text><![CDATA[<p>We are given \[ \displaystyle f={@f@}\] and \(x, y, u\) are subject to percentage relative errors of \({@error_x@}\)%, \({@error_y@}\)% and \({@error_u@}\)% respectively.&nbsp;</p>
<p>We are asked to find the approximate percentage relative error in \(f\).</p>
<p><br></p>
<p>First, find \(\dfrac{\partial f}{\partial x}, \dfrac{\partial f}{\partial y}\) and \(\dfrac{\partial f}{\partial u}:\)</p>
<p>\(\dfrac{\partial f}{\partial x} = \displaystyle {@f_x@}\)</p>
<p>\(\dfrac{\partial f}{\partial y} = \displaystyle {@f_y@}\)</p>
<p>\(\dfrac{\partial f}{\partial u} =&nbsp;\displaystyle {@f_u@}\)</p>
<p>Now we write down the expression of \( \delta f .\)</p>
<p>\[ \delta f&nbsp;\simeq {@f_x@} \delta x +{@f_y@} \delta y {@f_u@} \delta u \]</p>
<p>Hence we write down an expression for the percentage relative error in \(f\):</p>
<p>\[&nbsp;\dfrac{\delta f}{f} \times 100 \simeq {@f_x@} \times {@f_inv@} \delta x \times 100 +{@f_y@} \times {@f_inv@} \delta y \times 100 {@f_u@} \times {@f_inv@} \delta u \times 100 \]</p>
<p>Then we calculate the values of the percentage relative error:</p>
<p>\[\dfrac{\delta f}{f} \times 100 \simeq {@delta_x_coeff@} \dfrac{\delta x}{x} \times 100 + {@delta_y_coeff@} \dfrac{\delta y}{y} \times 100&nbsp; {@delta_u_coeff@} \dfrac{\delta u}{u} \times 100\]
</p>
<p><br></p>
<p>Inputting the the percentage relative errors of \(\displaystyle {@error_x@}\)%, \({@error_y@}\)%, \({@error_u@}\)% in \(x,y,u\), the value of the percentage relative error is&nbsp; \({@percent_error@} \%.\)</p>]]></text>
    </generalfeedback>
    <defaultgrade>1</defaultgrade>
    <penalty>0.1</penalty>
    <hidden>0</hidden>
    <idnumber/>
    <stackversion>
      <text>2020120600</text>
    </stackversion>
    <questionvariables>
      <text>a: rand(3)+1;
b: rand(3)+1;
c: rand(3)+1;
f: ((x^a)*(y^b))/(u^c);
f_inv: 1/f;

d: rand([1,2]);
e: rand([2,3]);
error_x: d;
error_y: -1*d;
error_u: e;

f_x: diff(f, x);
f_y: diff(f, y);
f_u: diff(f, u);

delta_x_coeff: (f_x*f_inv)*x;
delta_y_coeff: (f_y*f_inv)*y;
delta_u_coeff: (f_u*f_inv)*u;

percent_error: (delta_x_coeff*error_x)+(delta_y_coeff*error_y)+(delta_u_coeff*error_u);</text>
    </questionvariables>
    <specificfeedback format="html">
      <text/>
    </specificfeedback>
    <questionnote format="moodle_auto_format">
      <text>\[ f ={@f@}, \, f_x + {@f_x@}, \, f_y= {@f_y@}, \, f_u = {@f_u@} \]
\[ \text{relative error} = {@percent_error@} \% \]</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>f_x</tans>
      <boxsize>10</boxsize>
      <strictsyntax>1</strictsyntax>
      <insertstars>0</insertstars>
      <syntaxhint/>
      <syntaxattribute>0</syntaxattribute>
      <forbidwords/>
      <allowwords>x,y,u</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>f_y</tans>
      <boxsize>10</boxsize>
      <strictsyntax>1</strictsyntax>
      <insertstars>0</insertstars>
      <syntaxhint/>
      <syntaxattribute>0</syntaxattribute>
      <forbidwords/>
      <allowwords>x,y,u</allowwords>
      <forbidfloat>1</forbidfloat>
      <requirelowestterms>0</requirelowestterms>
      <checkanswertype>0</checkanswertype>
      <mustverify>1</mustverify>
      <showvalidation>3</showvalidation>
      <options/>
    </input>
    <input>
      <name>ans3</name>
      <type>algebraic</type>
      <tans>f_u</tans>
      <boxsize>10</boxsize>
      <strictsyntax>1</strictsyntax>
      <insertstars>0</insertstars>
      <syntaxhint/>
      <syntaxattribute>0</syntaxattribute>
      <forbidwords/>
      <allowwords>x,y,u</allowwords>
      <forbidfloat>1</forbidfloat>
      <requirelowestterms>0</requirelowestterms>
      <checkanswertype>0</checkanswertype>
      <mustverify>1</mustverify>
      <showvalidation>3</showvalidation>
      <options/>
    </input>
    <input>
      <name>ans4</name>
      <type>algebraic</type>
      <tans>delta_x_coeff</tans>
      <boxsize>3</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>ans5</name>
      <type>algebraic</type>
      <tans>delta_y_coeff</tans>
      <boxsize>3</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>ans6</name>
      <type>algebraic</type>
      <tans>delta_u_coeff</tans>
      <boxsize>3</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>ans7</name>
      <type>algebraic</type>
      <tans>percent_error</tans>
      <boxsize>3</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>f_x</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>
    <prt>
      <name>prt2</name>
      <value>1.0000000</value>
      <autosimplify>1</autosimplify>
      <feedbackstyle>1</feedbackstyle>
      <feedbackvariables>
        <text/>
      </feedbackvariables>
      <node>
        <name>0</name>
        <description/>
        <answertest>AlgEquiv</answertest>
        <sans>ans2</sans>
        <tans>f_y</tans>
        <testoptions/>
        <quiet>0</quiet>
        <truescoremode>=</truescoremode>
        <truescore>1.0000000</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>
    </prt>
    <prt>
      <name>prt3</name>
      <value>1.0000000</value>
      <autosimplify>1</autosimplify>
      <feedbackstyle>1</feedbackstyle>
      <feedbackvariables>
        <text/>
      </feedbackvariables>
      <node>
        <name>0</name>
        <description/>
        <answertest>AlgEquiv</answertest>
        <sans>ans3</sans>
        <tans>f_u</tans>
        <testoptions/>
        <quiet>0</quiet>
        <truescoremode>=</truescoremode>
        <truescore>1.0000000</truescore>
        <truepenalty/>
        <truenextnode>-1</truenextnode>
        <trueanswernote>prt3-1-T</trueanswernote>
        <truefeedback format="html">
          <text/>
        </truefeedback>
        <falsescoremode>=</falsescoremode>
        <falsescore>0.0000000</falsescore>
        <falsepenalty/>
        <falsenextnode>-1</falsenextnode>
        <falseanswernote>prt3-1-F</falseanswernote>
        <falsefeedback format="html">
          <text/>
        </falsefeedback>
      </node>
    </prt>
    <prt>
      <name>prt4</name>
      <value>1.0000000</value>
      <autosimplify>1</autosimplify>
      <feedbackstyle>1</feedbackstyle>
      <feedbackvariables>
        <text/>
      </feedbackvariables>
      <node>
        <name>0</name>
        <description/>
        <answertest>AlgEquiv</answertest>
        <sans>ans4</sans>
        <tans>delta_x_coeff</tans>
        <testoptions/>
        <quiet>0</quiet>
        <truescoremode>=</truescoremode>
        <truescore>1.0000000</truescore>
        <truepenalty/>
        <truenextnode>-1</truenextnode>
        <trueanswernote>prt4-1-T</trueanswernote>
        <truefeedback format="html">
          <text/>
        </truefeedback>
        <falsescoremode>=</falsescoremode>
        <falsescore>0.0000000</falsescore>
        <falsepenalty/>
        <falsenextnode>-1</falsenextnode>
        <falseanswernote>prt4-1-F</falseanswernote>
        <falsefeedback format="html">
          <text/>
        </falsefeedback>
      </node>
    </prt>
    <prt>
      <name>prt5</name>
      <value>1.0000000</value>
      <autosimplify>1</autosimplify>
      <feedbackstyle>1</feedbackstyle>
      <feedbackvariables>
        <text/>
      </feedbackvariables>
      <node>
        <name>0</name>
        <description/>
        <answertest>AlgEquiv</answertest>
        <sans>ans5</sans>
        <tans>delta_y_coeff</tans>
        <testoptions/>
        <quiet>0</quiet>
        <truescoremode>=</truescoremode>
        <truescore>1.0000000</truescore>
        <truepenalty/>
        <truenextnode>-1</truenextnode>
        <trueanswernote>prt5-1-T</trueanswernote>
        <truefeedback format="html">
          <text/>
        </truefeedback>
        <falsescoremode>=</falsescoremode>
        <falsescore>0.0000000</falsescore>
        <falsepenalty/>
        <falsenextnode>-1</falsenextnode>
        <falseanswernote>prt5-1-F</falseanswernote>
        <falsefeedback format="html">
          <text/>
        </falsefeedback>
      </node>
    </prt>
    <prt>
      <name>prt6</name>
      <value>1.0000000</value>
      <autosimplify>1</autosimplify>
      <feedbackstyle>1</feedbackstyle>
      <feedbackvariables>
        <text/>
      </feedbackvariables>
      <node>
        <name>0</name>
        <description/>
        <answertest>AlgEquiv</answertest>
        <sans>ans6</sans>
        <tans>delta_u_coeff</tans>
        <testoptions/>
        <quiet>0</quiet>
        <truescoremode>=</truescoremode>
        <truescore>1.0000000</truescore>
        <truepenalty/>
        <truenextnode>-1</truenextnode>
        <trueanswernote>prt6-1-T</trueanswernote>
        <truefeedback format="html">
          <text/>
        </truefeedback>
        <falsescoremode>=</falsescoremode>
        <falsescore>0.0000000</falsescore>
        <falsepenalty/>
        <falsenextnode>-1</falsenextnode>
        <falseanswernote>prt6-1-F</falseanswernote>
        <falsefeedback format="html">
          <text/>
        </falsefeedback>
      </node>
    </prt>
    <prt>
      <name>prt7</name>
      <value>1.0000000</value>
      <autosimplify>1</autosimplify>
      <feedbackstyle>1</feedbackstyle>
      <feedbackvariables>
        <text/>
      </feedbackvariables>
      <node>
        <name>0</name>
        <description/>
        <answertest>AlgEquiv</answertest>
        <sans>ans7</sans>
        <tans>percent_error</tans>
        <testoptions/>
        <quiet>0</quiet>
        <truescoremode>=</truescoremode>
        <truescore>1.0000000</truescore>
        <truepenalty/>
        <truenextnode>-1</truenextnode>
        <trueanswernote>prt7-1-T</trueanswernote>
        <truefeedback format="html">
          <text/>
        </truefeedback>
        <falsescoremode>=</falsescoremode>
        <falsescore>0.0000000</falsescore>
        <falsepenalty/>
        <falsenextnode>-1</falsenextnode>
        <falseanswernote>prt7-1-F</falseanswernote>
        <falsefeedback format="html">
          <text/>
        </falsefeedback>
      </node>
    </prt>
    <deployedseed>740070294</deployedseed>
    <deployedseed>1764422243</deployedseed>
    <deployedseed>948258138</deployedseed>
    <deployedseed>1629581274</deployedseed>
    <deployedseed>526142968</deployedseed>
    <deployedseed>1159463694</deployedseed>
    <deployedseed>1971254069</deployedseed>
    <deployedseed>1164027021</deployedseed>
    <deployedseed>37565122</deployedseed>
    <deployedseed>879631441</deployedseed>
    <qtest>
      <testcase>1</testcase>
      <description/>
      <testinput>
        <name>ans1</name>
        <value>f_x</value>
      </testinput>
      <testinput>
        <name>ans2</name>
        <value>f_y</value>
      </testinput>
      <testinput>
        <name>ans3</name>
        <value>f_u</value>
      </testinput>
      <testinput>
        <name>ans4</name>
        <value>delta_x_coeff</value>
      </testinput>
      <testinput>
        <name>ans5</name>
        <value>delta_y_coeff</value>
      </testinput>
      <testinput>
        <name>ans6</name>
        <value>delta_u_coeff</value>
      </testinput>
      <testinput>
        <name>ans7</name>
        <value>percent_error</value>
      </testinput>
      <expected>
        <name>prt1</name>
        <expectedscore>1.0000000</expectedscore>
        <expectedpenalty>0.0000000</expectedpenalty>
        <expectedanswernote>prt1-1-T</expectedanswernote>
      </expected>
      <expected>
        <name>prt2</name>
        <expectedscore>1.0000000</expectedscore>
        <expectedpenalty>0.0000000</expectedpenalty>
        <expectedanswernote>prt2-1-T</expectedanswernote>
      </expected>
      <expected>
        <name>prt3</name>
        <expectedscore>1.0000000</expectedscore>
        <expectedpenalty>0.0000000</expectedpenalty>
        <expectedanswernote>prt3-1-T</expectedanswernote>
      </expected>
      <expected>
        <name>prt4</name>
        <expectedscore>1.0000000</expectedscore>
        <expectedpenalty>0.0000000</expectedpenalty>
        <expectedanswernote>prt4-1-T</expectedanswernote>
      </expected>
      <expected>
        <name>prt5</name>
        <expectedscore>1.0000000</expectedscore>
        <expectedpenalty>0.0000000</expectedpenalty>
        <expectedanswernote>prt5-1-T</expectedanswernote>
      </expected>
      <expected>
        <name>prt6</name>
        <expectedscore>1.0000000</expectedscore>
        <expectedpenalty>0.0000000</expectedpenalty>
        <expectedanswernote>prt6-1-T</expectedanswernote>
      </expected>
      <expected>
        <name>prt7</name>
        <expectedscore>1.0000000</expectedscore>
        <expectedpenalty>0.0000000</expectedpenalty>
        <expectedanswernote>prt7-1-T</expectedanswernote>
      </expected>
    </qtest>
    <qtest>
      <testcase>2</testcase>
      <description/>
      <testinput>
        <name>ans1</name>
        <value>ev(f_x+1,simp)</value>
      </testinput>
      <testinput>
        <name>ans2</name>
        <value>ev(f_y+1,simp)</value>
      </testinput>
      <testinput>
        <name>ans3</name>
        <value>ev(f_u+1,simp)</value>
      </testinput>
      <testinput>
        <name>ans4</name>
        <value>ev(delta_x_coeff+1,simp)</value>
      </testinput>
      <testinput>
        <name>ans5</name>
        <value>ev(delta_y_coeff+1,simp)</value>
      </testinput>
      <testinput>
        <name>ans6</name>
        <value>ev(delta_u_coeff+1,simp)</value>
      </testinput>
      <testinput>
        <name>ans7</name>
        <value>ev(percent_error+1,simp)</value>
      </testinput>
      <expected>
        <name>prt1</name>
        <expectedscore>0.0000000</expectedscore>
        <expectedpenalty>0.1000000</expectedpenalty>
        <expectedanswernote>prt1-1-F</expectedanswernote>
      </expected>
      <expected>
        <name>prt2</name>
        <expectedscore>0.0000000</expectedscore>
        <expectedpenalty>0.1000000</expectedpenalty>
        <expectedanswernote>prt2-1-F</expectedanswernote>
      </expected>
      <expected>
        <name>prt3</name>
        <expectedscore>0.0000000</expectedscore>
        <expectedpenalty>0.1000000</expectedpenalty>
        <expectedanswernote>prt3-1-F</expectedanswernote>
      </expected>
      <expected>
        <name>prt4</name>
        <expectedscore>0.0000000</expectedscore>
        <expectedpenalty>0.1000000</expectedpenalty>
        <expectedanswernote>prt4-1-F</expectedanswernote>
      </expected>
      <expected>
        <name>prt5</name>
        <expectedscore>0.0000000</expectedscore>
        <expectedpenalty>0.1000000</expectedpenalty>
        <expectedanswernote>prt5-1-F</expectedanswernote>
      </expected>
      <expected>
        <name>prt6</name>
        <expectedscore>0.0000000</expectedscore>
        <expectedpenalty>0.1000000</expectedpenalty>
        <expectedanswernote>prt6-1-F</expectedanswernote>
      </expected>
      <expected>
        <name>prt7</name>
        <expectedscore>0.0000000</expectedscore>
        <expectedpenalty>0.1000000</expectedpenalty>
        <expectedanswernote>prt7-1-F</expectedanswernote>
      </expected>
    </qtest>
  </question>
</quiz>
