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

 <p>A man owns a house in town and a cottage in the country. In any one year the probability of the town house being burgled is \(\displaystyle{{@cc@}}\) and the probability of the country cottage being burgled is\(\displaystyle{{@dd@}}\).</p>
<p>In any one year what is the probability that:</p>

<ol class="HELM_parts">
  <li><p>Both will be burgled? [[input:ans2]] [[validation:ans2]] [[feedback:prt2]]</p></li>
  <li><p>One or the other (but not both) will be burgled? [[input:ans3]] [[validation:ans3]] [[feedback:prt3]]</p></li>
</ol>]]></text>
    </questiontext>
    <generalfeedback format="html">
      <text><![CDATA[<p>A man owns a house in town and a cottage in the country. In any one year the probability of the town house being burgled is \(\displaystyle{{@cc@}}\) and the probability of the country cottage being burgled is\(\displaystyle{{@dd@}}\).</p>

<ol class="HELM_parts">
    <li>
        <p>\(H=\{\)house is burgled\(\}\ \ C=\{\)cottage is burgled\(\}\) \[\text{P}(H\cap C)=\text{P}(H)\text{P}(C)=\left({@cc@}\right)\left({@dd@}\right)={@ta21@}\] since events independent.</p>
    </li>
    <li>
        <p>\[\begin{align} \text{P(one or the other (but not both))} &amp; = \text{P}((H \cap C')\cup (H' \cap C)) \\ &amp; =\text{P}(H\cap C')+\text{P}(H'\cap C) \\ &amp;= \text{P}(H)\text{P}(C')+\text{P}(H')\text{P}(C) \\ &amp; = \left({@cc@}\right)\left({@ndd@}\right)+\left({@ncc@}\right)\left({@dd@}\right) \\ &amp;={@ta22@}. \end{align}\]</p>
    </li>
</ol>]]></text>
    </generalfeedback>
    <defaultgrade>1</defaultgrade>
    <penalty>0.1</penalty>
    <hidden>0</hidden>
    <idnumber/>
    <stackversion>
      <text>2021072200</text>
    </stackversion>
    <questionvariables>
      <text>cc:(1+rand(6))/100
ncc:1-cc
dd:(1+rand(6))/100
ndd:1-dd
ta21:cc*dd
ta22:cc*ndd+ncc*dd
ee:3+rand(3)
ff: 6+rand(4)
gg:ff-ee
ta3:binomial(ff-1,ee-1)*(2/3)^(ee-1)*(1/3)^(ff-ee)</text>
    </questionvariables>
    <specificfeedback format="html">
      <text/>
    </specificfeedback>
    <questionnote format="moodle_auto_format">
      <text>\( P_1 = {@cc@}, P_2={@dd@}, \quad P_{both burgled}= {@ta21@}, \, P_{one burgled} = {@ta22@} \)</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>ans2</name>
      <type>algebraic</type>
      <tans>ta21</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>ans3</name>
      <type>algebraic</type>
      <tans>ta22</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>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>ta21</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>ta22</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>
    <deployedseed>1018464604</deployedseed>
    <deployedseed>2045632152</deployedseed>
    <deployedseed>1352706379</deployedseed>
    <deployedseed>137033799</deployedseed>
    <deployedseed>1581453660</deployedseed>
    <deployedseed>250797240</deployedseed>
    <deployedseed>1961360857</deployedseed>
    <deployedseed>644436988</deployedseed>
    <deployedseed>1299671571</deployedseed>
    <deployedseed>853988819</deployedseed>
    <qtest>
      <testcase>1</testcase>
      <description/>
      <testinput>
        <name>ans2</name>
        <value>ta21</value>
      </testinput>
      <testinput>
        <name>ans3</name>
        <value>ta22</value>
      </testinput>
      <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>
    </qtest>
    <qtest>
      <testcase>2</testcase>
      <description/>
      <testinput>
        <name>ans2</name>
        <value>ta21+21</value>
      </testinput>
      <testinput>
        <name>ans3</name>
        <value>ta22+22</value>
      </testinput>
      <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>
    </qtest>
  </question>
</quiz>
