<?xml version="1.0" encoding="UTF-8"?>
<quiz>
  <question type="stack">
    <name>
      <text>39.1.7.3 Probability Intervals Exercise 2</text>
    </name>
    <questiontext format="html">
      <text><![CDATA[<p class="HELM_exercise">Exercise</p>

<p>For the standard Normal random variable \(Z\), find the value \(k\) to 2 decimal places where:</p>
<ol class="HELM_parts">
<li><p>\(Z\) exceeds \(k\) on \({@numa@}\%\) of occasions.</p>
<p>\(k = \)[[input:ans1]] [[validation:ans1]] [[feedback:prt1]]</p></li>
<li><p>\(Z\) exceeds \(k\) on \({@numb@}\%\) of occasions.</p>
<p>\(k = \)[[input:ans2]] [[validation:ans2]] [[feedback:prt2]]</p></li></ol>]]></text>
    </questiontext>
    <generalfeedback format="html">
      <text><![CDATA[<h4 class="HELM_solution">Solution</h4>

<ol class="HELM_parts">
<li>The probability for \(\text{P}(Z&gt;k)\) is less than \(0.5\), so the value for \(k\) will be positive. Applying the complement rule and partitioning the interval at \(0\) gives: \[\begin{align*}\text{P}(Z&gt;k) &amp;= 1 - \text{P}(Z &lt; k)\\&amp; = 1 - \left[\text{P}(Z&lt;0) + \text{P}(0&lt;Z&lt;k)\right] \\&amp;= 0.5 - \text{P}(0&lt;Z&lt;k). \end{align*}\] If this probability is to equal \({@displaydp(numa,2)@}\%\) then \(\text{P}(0&lt;Z&lt;k) = {@displaydp(0.5-prob1,4)@}.\) Reading from the table of standard Normal probabilities, we see that \(k = {@displaydp(ta1,2)@}\) to 2 decimal places.</li>
<li>On the contrary, in this case&nbsp;\(\text{P}(Z&gt;k)\) is greater than \(0.5\) so the value for \(k\) will be negative. Using the symmetry of the standard Normal distribution we get: \[\begin{align*}\text{P}(Z&gt;k) &amp;= \text{P}(Z&lt; -k) \\&amp;= \text{P}(Z&lt; 0) + \text{P}(0 &lt; Z&lt; -k) \\&amp;= 0.5 + \text{P}(0 &lt; Z&lt; -k).\end{align*}\] For this probability to be \({@displaydp(numb,2)@}\%\) then we require that \(\text{P}(0 &lt; Z&lt; -k) = {@displaydp(prob2-0.5,4)@}\).&nbsp;Reading from the table of standard Normal probabilities, we see that \(-k = {@displaydp(-ta2,2)@}\) and so&nbsp;\(k = {@displaydp(ta2,2)@}\) to 2 decimal places.</li>
</ol>]]></text>
    </generalfeedback>
    <defaultgrade>1</defaultgrade>
    <penalty>0</penalty>
    <hidden>0</hidden>
    <idnumber/>
    <stackversion>
      <text>2021072200</text>
    </stackversion>
    <questionvariables>
      <text>ta1: decimalplaces(float(rand_with_step(1.55, 1.75, 0.01)),2);
ta2: decimalplaces(float(rand_with_step(-2.50,-2.30,0.01)),2);
prob1: decimalplaces(float(1 - cdf_normal(ta1,0,1)),4);
prob2: decimalplaces(float(1 - cdf_normal(ta2,0,1)),4);
numa: decimalplaces(float(prob1*100),2);
numb: decimalplaces(float(prob2*100),2);

check1: decimalplaces(float(quantile_normal(1-numa/100,0,1)),2);
check2: decimalplaces(float(quantile_normal(1-numb/100,0,1)),2);</text>
    </questionvariables>
    <specificfeedback format="html">
      <text/>
    </specificfeedback>
    <questionnote format="moodle_auto_format">
      <text>(a) \({@displaydp(numa,2)@}\%, k = {@displaydp(ta1,2)@}, k_{\text{check}} = {@displaydp(check1,2)@}\)
(b) \({@displaydp(numb,2)@}\%, k = {@displaydp(ta2,2)@}, k_{\text{check}} = {@displaydp(check2,2)@}\)</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>numerical</type>
      <tans>dispdp(ta1,2)</tans>
      <boxsize>8</boxsize>
      <strictsyntax>1</strictsyntax>
      <insertstars>0</insertstars>
      <syntaxhint>to 2 d.p.</syntaxhint>
      <syntaxattribute>1</syntaxattribute>
      <forbidwords/>
      <allowwords/>
      <forbidfloat>0</forbidfloat>
      <requirelowestterms>0</requirelowestterms>
      <checkanswertype>1</checkanswertype>
      <mustverify>1</mustverify>
      <showvalidation>3</showvalidation>
      <options>maxdp:2, mindp:2</options>
    </input>
    <input>
      <name>ans2</name>
      <type>numerical</type>
      <tans>dispdp(ta2,2)</tans>
      <boxsize>8</boxsize>
      <strictsyntax>1</strictsyntax>
      <insertstars>0</insertstars>
      <syntaxhint>to 2 d.p.</syntaxhint>
      <syntaxattribute>1</syntaxattribute>
      <forbidwords/>
      <allowwords/>
      <forbidfloat>0</forbidfloat>
      <requirelowestterms>0</requirelowestterms>
      <checkanswertype>1</checkanswertype>
      <mustverify>1</mustverify>
      <showvalidation>3</showvalidation>
      <options>maxdp:2, mindp:2</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>NumDecPlaces</answertest>
        <sans>ans1</sans>
        <tans>ta1</tans>
        <testoptions>2</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>NumDecPlaces</answertest>
        <sans>ans2</sans>
        <tans>ta2</tans>
        <testoptions>2</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>
    <deployedseed>708059017</deployedseed>
    <deployedseed>1308783594</deployedseed>
    <deployedseed>1588742177</deployedseed>
    <deployedseed>1328634882</deployedseed>
    <deployedseed>2078494612</deployedseed>
    <deployedseed>711744838</deployedseed>
    <deployedseed>424164919</deployedseed>
    <deployedseed>1840214698</deployedseed>
    <deployedseed>1218662763</deployedseed>
    <deployedseed>1400334549</deployedseed>
    <qtest>
      <testcase>1</testcase>
      <description/>
      <testinput>
        <name>ans1</name>
        <value>dispdp(ta1,2)</value>
      </testinput>
      <testinput>
        <name>ans2</name>
        <value>dispdp(ta2,2)</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>
    </qtest>
    <qtest>
      <testcase>2</testcase>
      <description/>
      <testinput>
        <name>ans1</name>
        <value>dispdp(ev(ta1+1,simp),2)</value>
      </testinput>
      <testinput>
        <name>ans2</name>
        <value>dispdp(ev(ta2+1,simp),2)</value>
      </testinput>
      <expected>
        <name>prt1</name>
        <expectedscore>0.0000000</expectedscore>
        <expectedpenalty>0.0000000</expectedpenalty>
        <expectedanswernote>prt1-1-F</expectedanswernote>
      </expected>
      <expected>
        <name>prt2</name>
        <expectedscore>0.0000000</expectedscore>
        <expectedpenalty>0.0000000</expectedpenalty>
        <expectedanswernote>prt2-1-F</expectedanswernote>
      </expected>
    </qtest>
  </question>
</quiz>
