qu.1.topic=NA Measures of Center@

qu.1.1.mode=Multiple Choice@
qu.1.1.name=1A. Mean # fails@
qu.1.1.comment=@
qu.1.1.editing=useHTML@
qu.1.1.solution=@
qu.1.1.algorithm=$Q="1A";
$FailPC=range(20,45,1);
$NumTakers=range(225,675,5);
$Ans=int(0.5+$FailPC*$NumTakers/100);
$Alt1=$Ans+int(range(0.2,0.4,0.05)*($NumTakers-$Ans));
$Alt2=int(range(0.65,0.95,0.05)*$Ans);
$Alt3=int(0.5*switch(rint(2),$Alt1+$Ans,$Alt2+$Ans));@
qu.1.1.uid=df2accbf-e4a5-4a56-b3ad-ab2fa1efebe8@
qu.1.1.info=  Use=Yes;
@
qu.1.1.question=<div title="STAT202/Test 3/Mean, Variance, &amp; SD/Q$Q  [32.]">The failure rate for taking the bar exam in Philadelphia is $FailPC%. If $NumTakers people take the bar exam, what is the mean for the number of failures?</div>@
qu.1.1.answer=4@
qu.1.1.choice.1=$Alt1@
qu.1.1.choice.2=$Alt2@
qu.1.1.choice.3=$Alt3@
qu.1.1.choice.4=$Ans@
qu.1.1.fixed=@

qu.1.2.mode=Multiple Choice@
qu.1.2.name=3A. Mean of cartoons@
qu.1.2.comment=@
qu.1.2.editing=useHTML@
qu.1.2.solution=@
qu.1.2.algorithm=$Q=4;
$P0 = range(0.1,0.15,0.001);
$P1 = range(0.1,0.15,0.001);
$P2 = range(0.05,0.15,0.001);
$P3 = range(0.1,0.15,0.001);
$P4 = range(0.05,0.15,0.001);
$P5 = 1-$P0-$P1-$P2-$P3-$P4;
$X = (0*$P0)+(1*$P1)+(2*$P2)+(3*$P3)+(4*$P4)+(5*$P5);
$ANS = $X;
$ALT1 = $X^0.5;
$ALT2 = $X^0.3;
$ALT3 = range(2,3,0.001);@
qu.1.2.uid=6051dc99-4b87-4a46-817a-9d9c4533f3ee@
qu.1.2.info=  Use=Yes;
@
qu.1.2.question=<div title="STAT202/Test 3/Mean, Variance, &amp; SD/Q$Q  [36.]">The number of cartoons watched by Mrs. Kelly's first grade class on Saturday morning is shown below.<br />
<div align="center"><center>
<table cellspacing="1" bordercolor="#111111" border="0" width="20%" id="AutoNumber1" style="border-collapse: collapse;">
    <tbody>
        <tr>
            <td>
            <p align="center"><em>x</em></p>
            </td>
            <td>
            <p align="center"><em>P(x)</em></p>
            </td>
        </tr>
        <tr>
            <td align="center">0</td>
            <td align="center">$P0</td>
        </tr>
        <tr>
            <td align="center">1</td>
            <td align="center">$P1</td>
        </tr>
        <tr>
            <td align="center">2</td>
            <td align="center">$P2</td>
        </tr>
        <tr>
            <td align="center">3</td>
            <td align="center">$P3</td>
        </tr>
        <tr>
            <td align="center">4</td>
            <td align="center">$P4</td>
        </tr>
        <tr>
            <td align="center">5</td>
            <td align="center">$P5</td>
        </tr>
    </tbody>
</table>
</center></div>
What is the mean for the probability distribution above?</div>@
qu.1.2.answer=1@
qu.1.2.choice.1=$ANS@
qu.1.2.choice.2=$ALT1@
qu.1.2.choice.3=$ALT2@
qu.1.2.choice.4=$ALT3@
qu.1.2.fixed=@

qu.1.3.mode=Inline@
qu.1.3.name=8. Mean&StDev of (X+Y)/2@
qu.1.3.comment=@
qu.1.3.editing=useHTML@
qu.1.3.solution=@
qu.1.3.algorithm=$Q = 8;
$x=decimal(3,range(-.03,0.02,.01));
$y=decimal(3,range(0.03,0.06,.01));
$EX=maple("$x+2");
$EY=maple("$y+2");
$ans1=maple("($EY+$EX)/2");
$stdevX=decimal(3,range(.001,.002,.001));
$stdevY=decimal(3,range(.003,.005,.001));
$VarX=maple("$stdevX*$stdevX");
$VarY=maple("$stdevY*$stdevY");
$ans2=maple("sqrt($VarX+$VarY)/2");@
qu.1.3.uid=ee486ae7-16d1-4e0e-8757-21ac766fd18e@
qu.1.3.weighting=1,1@
qu.1.3.numbering=alpha@
qu.1.3.part.1.name=sro_id_1@
qu.1.3.part.1.answer.units=@
qu.1.3.part.1.numStyle=   @
qu.1.3.part.1.editing=useHTML@
qu.1.3.part.1.showUnits=false@
qu.1.3.part.1.err=0.01@
qu.1.3.part.1.question=(Unset)@
qu.1.3.part.1.mode=Numeric@
qu.1.3.part.1.grading=toler_abs@
qu.1.3.part.1.negStyle=both@
qu.1.3.part.1.answer.num=$ans1@
qu.1.3.part.2.name=sro_id_2@
qu.1.3.part.2.answer.units=@
qu.1.3.part.2.numStyle=   @
qu.1.3.part.2.editing=useHTML@
qu.1.3.part.2.showUnits=false@
qu.1.3.part.2.err=0.0010@
qu.1.3.part.2.question=(Unset)@
qu.1.3.part.2.mode=Numeric@
qu.1.3.part.2.grading=toler_abs@
qu.1.3.part.2.negStyle=both@
qu.1.3.part.2.answer.num=$ans2@
qu.1.3.question=<p>You have two scales for measuring weights in a chemistry lab. Both scales give answers that vary a bit in repeated weighings of the same item. If the true weight of a compound is 2 grams (g), the first scale produces readings X that have mean $EX g and standard deviation $stdevX g. The second scale&rsquo;s readings Y have mean $EY g and standard deviation $stdevY g. You measure once with each scale and average the readings. Your result is Z=(X+Y)/2.</p><p>What is the mean of Z?&nbsp; (please round to 2 decimals)&nbsp; <1><span>&nbsp;</span><br />What is the standard deviation of Z? (please round to 4 decimals)&nbsp; <2><span>&nbsp;</span></p><p>&nbsp;</p>@

qu.1.4.mode=Multiple Choice@
qu.1.4.name=6A. Find the mean@
qu.1.4.comment=<p>The mean is, of course, <math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000' veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><munderover><mo lspace='0.0em' rspace='0.1666667em' stretchy='true' largeop='true' movablelimits='true'>&Sum;</mo><mrow><mi mathcolor='#800080'>i</mi></mrow><mi></mi></munderover><msub><mi>X</mi><mrow><mi>i</mi></mrow></msub><mo lspace='0.0em' rspace='0.0em'>&sdot;</mo><mi>P</mi><mfenced open='(' close=')' separators=','><mrow><msub><mi>X</mi><mrow><mi>i</mi></mrow></msub></mrow></mfenced></mrow></mstyle></math> which in this case is $X1($P1)+$X2($P2)+$X3($P3) = $Ans.</p>@
qu.1.4.editing=useHTML@
qu.1.4.solution=@
qu.1.4.algorithm=$Q="6A";
$X1=range(1,5,1);
$X2=$X1+1;
$X3=$X2+1;
$P1=range(0.15,0.45,0.01);
$P2=range(0.15,0.85-$P1,0.01);
$P3=1-$P1-$P2;
$Ans=$X1*$P1+$X2*$P2+$X3*$P3;
$Alt1=range($X1,0.95*$Ans,0.01);
$Alt2=range($Ans+0.01,$X3,0.01);
$Alt3=$Alt2+range(.1,.5,0.01);@
qu.1.4.uid=c0d62982-536c-45f7-924a-66d1bfb47830@
qu.1.4.info=  Use=Yes;
@
qu.1.4.question=<div title="STAT202/Test 3/Mean, Variance, &amp; SD/Q$Q  [38.]">Find the mean of the distribution shown.
<div align="center"><center>
<table cellspacing="5" bordercolor="#111111" border="0" width="200" style="border-collapse: collapse;" id="AutoNumber1">
    <tbody>
        <tr>
            <td>x</td>
            <td align="center">$X1</td>
            <td align="center">$X2</td>
            <td align="center">$X3</td>
        </tr>
        <tr>
            <td>P(x)</td>
            <td align="center">$P1</td>
            <td align="center">$P2</td>
            <td align="center">$P3</td>
        </tr>
    </tbody>
</table>
</center></div>
</div>@
qu.1.4.answer=4@
qu.1.4.choice.1=$Alt1@
qu.1.4.choice.2=$Alt2@
qu.1.4.choice.3=$Alt3@
qu.1.4.choice.4=$Ans@
qu.1.4.fixed=@

qu.2.topic=Expected Value@

qu.2.1.question=<div title="UW Statistics Bank/Numerical Analysis/Measures of Centre/Expected Value/Q$Q">A crop insurance company establishes the following loss table based upon previous claims <br />
<br />
<table cellspacing="2" cellpadding="2" border="0">
    <tbody>
        <tr>
            <td>percent loss</td>
            <td>|</td>
            <td align="right">0</td>
            <td align="right">25</td>
            <td align="right">50</td>
            <td align="right">100</td>
        </tr>
        <tr>
            <td>probability</td>
            <td>|</td>
            <td align="right">$p0</td>
            <td align="right">$p1</td>
            <td align="right">$p2</td>
            <td align="right">????</td>
        </tr>
    </tbody>
</table>
<br />
If they write policy that pays a maximum of \\$$s&nbsp;/hectare, their expected loss in dollars/hectare is approximately (4 decimals):</div>@
qu.2.1.answer.num=$Ans@
qu.2.1.answer.units=@
qu.2.1.showUnits=false@
qu.2.1.grading=toler_abs@
qu.2.1.err=.001@
qu.2.1.negStyle=minus@
qu.2.1.numStyle=thousands scientific dollars arithmetic@
qu.2.1.mode=Numeric@
qu.2.1.name=08a. Crop insurance loss@
qu.2.1.comment=<div class="shadedDiv descriptionSpan" style="margin-top: 0px; margin-bottom: 2px;">
<p>First note that P(100% loss) =$p3.</p>
<p>If X is policy payout, we can calculate</p>
<p><font size="3" face="Times New Roman"><em>E</em>(<em>X</em>) = $s( $x0*$p0 + $x1*$p1&nbsp; + $x2*$p2&nbsp; + $x3*$p3&nbsp; ) =&nbsp; $Ans</font></p>
</div>@
qu.2.1.editing=useHTML@
qu.2.1.solution=@
qu.2.1.algorithm=$Q="08a";
$p0=decimal(2,range(0.6,0.85,0.05));
$p1=decimal(2,range(0.05,0.90-$p0,0.01));
$p2=decimal(2,range(0.01,0.99-$p0-$p1,0.01));
$p3=1-$p0-$p1-$p2;
$k0=abs(0);
$k1=25;
$k2=50;
$k3=100;
$x0=abs($k0/100);
$x1=$k1/100;
$x2=$k2/100;
$x3=$k3/100;
$s=range(100, 250, 5);
$Ans=decimal(2,$s*($x1*$p1+$x0*$p0+$p2*$x2+$x3*$p3));@
qu.2.1.uid=9575af0f-1cff-427b-9aef-14c2104f3a85@
qu.2.1.info=  Course=230;
  Type=numeric;
@

qu.2.2.mode=Restricted Formula@
qu.2.2.name=02+. Derive E[(X+1)<sup>2</sup>] for B(n,p)@
qu.2.2.comment=<p>Recall that for <font size="3" face="Times New Roman"><em>X</em> ~ <em>B</em>(<em>n</em>,<em>p</em>)</font> we have <font size="3" face="Times New Roman"><em>E</em>(<em>X</em>) = <em>np</em></font> and <font size="3" face="Times New Roman">Var(<em>x</em>) = <em>np</em>(1-<em>p</em>)</font><br />
<br />
<font size="3" face="Times New Roman">E[(<em>X</em>+1)<sup>2</sup>] = E[<em>X</em><sup>2</sup>+2<em>X</em>+1] = E(<em>X</em><sup>2</sup>)+2E(<em>X</em>)+1</font> &nbsp; &nbsp; <span style="font-style: italic;">Now recall that <font size="3" face="Times New Roman">Var(X) = </font></span><font size="3" face="Times New Roman">E(<em>X</em><sup>2</sup>) - (E(<em>X</em>))<sup>2</sup></font> <span style="font-style: italic;">so</span>  <br />
<font size="3" face="Times New Roman">= Var(<em>X</em>)+(E(<em>X</em>))<sup>2</sup> + 2E(<em>X</em>)+1 </font><br />
<font size="3" face="Times New Roman">= Var(<em>X</em>) + (1+E(<em>X</em>))<sup>2</sup></font> <br />
<font size="3" face="Times New Roman">= <em>np</em>(1 - <em>p</em>) + (1 + <em>np</em>)<sup>2</sup></font></p>@
qu.2.2.editing=useHTML@
qu.2.2.solution=@
qu.2.2.algorithm=@
qu.2.2.uid=fee35765-69dd-419d-9914-4e7a08ac241e@
qu.2.2.info=  Difficulty=2;
  Keyword=binomial;
  Author=Sean Scott;
  Algorithmic=no;
@
qu.2.2.question=<div title="UW Statistics Bank/Numerical Analysis/Measures of Centre/Expected Value/Q$Q">Suppose <font size="3" face="Times New Roman"><em>X</em> ~ B(<em>n</em>,<em>p</em>)</font> is a Binomial Random Variable. Derive (and simplify) a formula for <font size="3" face="Times New Roman">E[(<em>X</em>+1)<sup>2</sup>]</font>.</div>@
qu.2.2.answer=np(1-p) + (1+np)^2@

qu.2.3.mode=Inline@
qu.2.3.name=24+. Difference in scales@
qu.2.3.comment=<p><br />
Using E(aX + bY) = aE(X) + bE(Y) we get E(X - Y) = $EX - $EY = $AnsMean g.</p>
<p>Now recall that Var(x) = [SD(x)]<sup>2</sup>&nbsp; and Var(aX + bY) = a<sup>2</sup>Var(X) + b<sup>2</sup>Var(Y) + 2abCov(X, Y)</p>
<p>Here X and Y are independent, so Cov(X, Y) = 0 and we have:</p>
<p>Var(X - Y) = Var(X) + Var(-Y) = Var(X) + Var(Y)&nbsp; so <math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000' veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><mi>SD</mi><mfenced open='(' close=')' separators=','><mrow><mi>X</mi><mo lspace='0.2222222em' rspace='0.2222222em'>&minus;</mo><mi>Y</mi></mrow></mfenced><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><msqrt><mrow><mi mathvariant='normal'>$TX</mi><mo lspace='0.2222222em' rspace='0.2222222em'>&times;</mo><msup><mn>10</mn><mrow><mo lspace='0.2222222em' rspace='0.2222222em'>&minus;</mo><mi mathvariant='normal'>$NX</mi></mrow></msup><mo lspace='0.2222222em' rspace='0.2222222em'>&plus;</mo><mi mathvariant='normal'>$TY</mi><mo lspace='0.2222222em' rspace='0.2222222em'>&times;</mo><msup><mn>10</mn><mrow><mo lspace='0.2222222em' rspace='0.2222222em'>&minus;</mo><mi mathvariant='normal'>$NY</mi></mrow></msup></mrow></msqrt><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mi mathvariant='normal'>$AnsSD</mi></mrow></mstyle></math></p>@
qu.2.3.editing=useHTML@
qu.2.3.solution=@
qu.2.3.algorithm=$Q = "24+";
$EX=decimal(3,range(1.998,2.001,.001));
$EY=decimal(3,range(2.002,2.004,.001));
$AnsMean=$EY-$EX;
$stdevX=decimal(3,range(.001,.002,.0005));
$stdevY=decimal(3,range(.003,.005,.0005));
$VarX=$stdevX*$stdevX;
$VarY=$stdevY*$stdevY;
$NX	=	if(ge($VarX,10^-5),5,6);
$NY	=	if(ge($VarY,10^-5),5,6);
$TX	=	$VarX*10^$NX;
$TY	=	$VarY*10^$NY;
$AnsSD=decimal(4,sqrt($VarX+$VarY));
$Which=rint(5);
$Align=switch(rint(2),"Left","Right");@
qu.2.3.uid=ca4dea83-fa3d-4322-b9ec-cb3bdb700b84@
qu.2.3.info=  Type=numeric;
  Course=202;
@
qu.2.3.weighting=1,1@
qu.2.3.numbering=alpha@
qu.2.3.part.1.name=sro_id_1@
qu.2.3.part.1.answer.units=@
qu.2.3.part.1.numStyle=   @
qu.2.3.part.1.editing=useHTML@
qu.2.3.part.1.showUnits=false@
qu.2.3.part.1.err=0.0010@
qu.2.3.part.1.question=(Unset)@
qu.2.3.part.1.mode=Numeric@
qu.2.3.part.1.grading=toler_abs@
qu.2.3.part.1.negStyle=both@
qu.2.3.part.1.answer.num=$AnsMean@
qu.2.3.part.2.name=sro_id_2@
qu.2.3.part.2.answer.units=@
qu.2.3.part.2.numStyle=   @
qu.2.3.part.2.editing=useHTML@
qu.2.3.part.2.showUnits=false@
qu.2.3.part.2.err=0.0010@
qu.2.3.part.2.question=(Unset)@
qu.2.3.part.2.mode=Numeric@
qu.2.3.part.2.grading=toler_abs@
qu.2.3.part.2.negStyle=both@
qu.2.3.part.2.answer.num=$AnsSD@
qu.2.3.question=<div title="UW Statistics Bank/Numerical Analysis/Measures of Centre/Expected Value/Q$Q"><img hspace="4" align="$Align" src="__BASE_URI__NA/MoC/ExpectedValue/Scale$Which.gif" alt="Scale" title="Scale [IMG:Scale$Which.gif]" />You have two scales for measuring weights in a chemistry lab. Both scales give answers that vary a bit in repeated weighings of the same item. If the true weight of a compound is 2 grams (g), the first scale produces readings X that have mean $EX g and standard deviation $stdevX g. The second scale&rsquo;s readings Y have mean $EY g and standard deviation $stdevY g. (Assume that the readings X and Y are independent.) <br /><p><br />What is the mean of the difference Y-X between the readings (please round to 4 decimals)? <span>&nbsp;</span><1><span>&nbsp;</span></p><p>What is the standard deviation of the difference Y-X between the readings (please round to 4 decimals)? <span>&nbsp;</span><2><span>&nbsp;</span></p></div>@

qu.2.4.mode=Multiple Choice@
qu.2.4.name=08b. Crop insurance loss@
qu.2.4.comment=<div class="shadedDiv descriptionSpan" style="margin-top: 0px; margin-bottom: 2px;">
<p>First note that P(100% loss) =$p3.</p>
<p>If X is policy payout, we can calculate</p>
<p><font size="3" face="Times New Roman"><em>E</em>(<em>X</em>) = $s( $x0*$p0 + $x1*$p1&nbsp; + $x2*$p2&nbsp; + $x3*$p3&nbsp; ) =&nbsp; $Ans</font></p>
</div>@
qu.2.4.editing=useHTML@
qu.2.4.solution=@
qu.2.4.algorithm=$Q="08b";
$p0=decimal(2,range(0.6,0.85,0.05));
$p1=decimal(2,range(0.05,0.90-$p0,0.01));
$p2=decimal(2,range(0.01,0.99-$p0-$p1,0.01));
$p3=1-$p0-$p1-$p2;
$k0=abs(0);
$k1=25;
$k2=50;
$k3=100;
$x0=abs($k0/100);
$x1=$k1/100;
$x2=$k2/100;
$x3=$k3/100;
$s=range(100, 250, 5);
$PreAns=$s*($x1*$p1+$x0*$p0+$p2*$x2+$x3*$p3);
$Ans=decimal(2,$PreAns);
$Alt1=decimal(2,range(1.2,1.6,0.01)*$Ans);
$Alt2=decimal(2,range(0.5,0.8,0.01)*$Ans);
$Alt3=decimal(2,0.5*($Ans+switch(rint(2),$Alt1,$Alt2)));@
qu.2.4.uid=932af62e-65f7-40cc-86ec-7c9895ce56ec@
qu.2.4.info=  Course=230;
  Type=MC;
@
qu.2.4.question=<div title="UW Statistics Bank/Numerical Analysis/Measures of Centre/Expected Value/Q$Q">A crop insurance company establishes the following loss table based upon previous claims <br />
<br />
<table cellspacing="2" cellpadding="2" border="0">
    <tbody>
        <tr>
            <td>percent loss</td>
            <td>|</td>
            <td align="right">0</td>
            <td align="right">25</td>
            <td align="right">50</td>
            <td align="right">100</td>
        </tr>
        <tr>
            <td>probability</td>
            <td>|</td>
            <td align="right">$p0</td>
            <td align="right">$p1</td>
            <td align="right">$p2</td>
            <td align="right">????</td>
        </tr>
    </tbody>
</table>
<br />
If they write policy that pays a maximum of \\$$s&nbsp;/hectare, their expected loss in dollars/hectare is approximately:</div>@
qu.2.4.answer=1@
qu.2.4.choice.1=$Ans@
qu.2.4.choice.2=$Alt1@
qu.2.4.choice.3=$Alt2@
qu.2.4.choice.4=$Alt3@
qu.2.4.fixed=4@

qu.2.5.mode=Multiple Choice@
qu.2.5.name=09. Rock concert@
qu.2.5.comment=<div style="margin-top: 0px; margin-bottom: 2px" class="shadedDiv descriptionSpan">Notice that P(cold day) = 1 - (P(warm) + P(cool)) = 1 - ($p1 + $p2) = $p3<br />
<br />
Expected Profit = \\$$x1*$p1 + \\$$x2*$p2&nbsp;+ (-\\$$x2)*$p3 = \\$$Ans</div>@
qu.2.5.editing=useHTML@
qu.2.5.solution=@
qu.2.5.algorithm=$Q=9;
$x1= range(15000, 25000, 1000);
$x2=range(3000, 6000, 1000);
$x3=range(5000, 12000, 1000);
$p1=decimal(2,range(0.5,0.8,0.05));
$p2=decimal(2,range(0.1,0.3,0.05));
$p3=1-$p1-$p2;
condition:gt($p3,0);
$Ans=$x1*$p1+$x2*$p2-$x3*$p3;
$Alt1=int(range(1.1,1.9,0.01)*$Ans);
$Alt2=int(range(0.5,0.9,0.01)*$Ans);
$Alt3=int(0.5*($Ans+switch(rint(2),$Alt1,$Alt2)));@
qu.2.5.uid=6d0b77b7-d587-4333-a88f-3fdd24523b51@
qu.2.5.info=  Course=230;
  Type=MC;
@
qu.2.5.question=<div title="UW Statistics Bank/Numerical Analysis/Measures of Centre/Expected Value/Q$Q">A rock concert producer has scheduled an outdoor concert. If it is warm that day, she expects to make a \\$$x1 profit. If it is cool that day, she expects to make a \\$$x2 &nbsp;profit. If it is very cold that day, she expects to suffer a \\$$x3 loss. Based upon historical records, the weather office has estimated the chances of a warm day to be $p1; the chances of a cool day to be $p2. What is the producer's expected profit?</div>@
qu.2.5.answer=1@
qu.2.5.choice.1=$Ans@
qu.2.5.choice.2=$Alt1@
qu.2.5.choice.3=$Alt2@
qu.2.5.choice.4=$Alt3@
qu.2.5.fixed=4@

qu.2.6.question=<div title="UW Statistics Bank/Numerical Analysis/Measures of Centre/Expected Value/Q$Q">In a game a fair coin is tossed $Toss times. If x Heads occur, you win 2<sup>x</sup> dollars (x = 0, 1..., $Toss). Find your expected winnings (2 decimal accuracy please).</div>@
qu.2.6.answer.num=$Ans@
qu.2.6.answer.units=@
qu.2.6.showUnits=false@
qu.2.6.grading=toler_abs@
qu.2.6.err=.1@
qu.2.6.negStyle=minus@
qu.2.6.numStyle=thousands scientific dollars arithmetic@
qu.2.6.mode=Numeric@
qu.2.6.name=14. Coin toss, x Heads pays $2<sup>x</sup>@
qu.2.6.comment=<p>Notice that if x Heads appear in $Toss rolls, then $Toss-x Tails appear. Let X be the r.v. representing the number of Heads in $Toss tosses. What is f(x) = P(X = x) ?<br />
<br />
Select x of the $Toss tosses in <math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000'  veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><mfenced open='(' close=')' separators=','><mrow><mtable rowalign='baseline' columnalign='center' groupalign='{left}' rowspacing='1.0ex'><mtr><mtd><mrow><mi mathvariant='normal'>$Toss</mi></mrow></mtd></mtr><mtr><mtd><mrow><mi>x</mi></mrow></mtd></mtr></mtable></mrow></mfenced><mrow></mrow><mrow><mtable rowalign='baseline' columnalign='center' groupalign='{left}' rowspacing='1.0ex'><mtr><mtd><mrow></mrow></mtd></mtr></mtable></mrow></mrow></mstyle></math> ways, then the probability of having all x of those Heads is <math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000' veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><msup><mfenced open='(' close=')' separators=','><mrow><mfrac><mn>1</mn><mrow><mn>2</mn></mrow></mfrac></mrow></mfenced><mrow><mi>x</mi></mrow></msup></mrow></mstyle></math> . Now the $Toss-x places for Tails are selected automatically and the probability of all them being Tails is <math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000'  veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><msup><mfenced open='(' close=')' separators=','><mrow><mfrac><mn>1</mn><mrow><mn>2</mn></mrow></mfrac></mrow></mfenced><mrow><mi mathvariant='normal'>$Toss</mi><mo lspace='0.2222222em' rspace='0.2222222em'>&minus;</mo><mi>x</mi></mrow></msup></mrow><mrow><mo lspace='0.0em' rspace='0.0em'>&#32;</mo></mrow></mstyle></math> so the probability of getting exactly x Heads in $Toss tosses is <math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000'  veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><mfenced open='(' close=')' separators=','><mrow><mtable rowalign='baseline' columnalign='center' groupalign='{left}' rowspacing='1.0ex'><mtr><mtd><mrow><mi mathvariant='normal'>$Toss</mi></mrow></mtd></mtr><mtr><mtd><mrow><mi>x</mi></mrow></mtd></mtr></mtable></mrow></mfenced><mrow></mrow><mrow><mtable rowalign='baseline' columnalign='center' groupalign='{left}' rowspacing='1.0ex'><mtr><mtd><mrow><mrow></mrow><mrow><msup><mfenced open='(' close=')' separators=','><mrow><mfrac><mn>1</mn><mrow><mn>2</mn></mrow></mfrac></mrow></mfenced><mrow><mi mathvariant='normal'>$Toss</mi></mrow></msup></mrow></mrow></mtd></mtr></mtable></mrow></mrow></mstyle></math>.  We want to find E(2<sup>x</sup>) =</p>
<p><math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000'  veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><munderover><mo lspace='0.0em' rspace='0.1666667em' stretchy='true' largeop='true' movablelimits='true'>&Sum;</mo><mrow><mi>x</mi><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mn>0</mn></mrow><mrow><mi mathvariant='normal'>$Toss</mi></mrow></munderover><msup><mn>2</mn><mrow><mi>x</mi></mrow></msup></mrow><mrow><mfenced open='(' close=')' separators=','><mrow><mtable rowalign='baseline' columnalign='center' groupalign='{left}' rowspacing='1.0ex'><mtr><mtd><mrow><mi mathvariant='normal'>$Toss</mi></mrow></mtd></mtr><mtr><mtd><mrow><mi>x</mi></mrow></mtd></mtr></mtable></mrow></mfenced><mrow></mrow><mrow><mtable rowalign='baseline' columnalign='center' groupalign='{left}' rowspacing='1.0ex'><mtr><mtd><mrow><msup><mfenced open='(' close=')' separators=','><mrow><mfrac><mn>1</mn><mrow><mn>2</mn></mrow></mfrac></mrow></mfenced><mrow><mi mathvariant='normal'>$Toss</mi></mrow></msup></mrow></mtd></mtr></mtable></mrow></mrow><mrow><mo lspace='0.0em' rspace='0.0em'>&#32;</mo></mrow></mstyle></math></p>
<p><math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000'  veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><msup><mfenced open='(' close=')' separators=','><mrow><mfrac><mn>1</mn><mrow><mn>2</mn></mrow></mfrac></mrow></mfenced><mrow><mi mathvariant='normal'>$Toss</mi></mrow></msup><munderover><mo lspace='0.0em' rspace='0.1666667em' stretchy='true' largeop='true' movablelimits='true'>&Sum;</mo><mrow><mi>x</mi><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mn>0</mn></mrow><mrow><mi mathvariant='normal'>$Toss</mi></mrow></munderover><mfenced open='(' close=')' separators=','><mrow><mtable rowalign='baseline' columnalign='center' groupalign='{left}' rowspacing='1.0ex'><mtr><mtd><mrow><mi mathvariant='normal'>$Toss</mi></mrow></mtd></mtr><mtr><mtd><mrow><mi>x</mi></mrow></mtd></mtr></mtable></mrow></mfenced><msup><mn>2</mn><mrow><mi>x</mi></mrow></msup><mtable rowalign='baseline' columnalign='center' groupalign='{left}' rowspacing='1.0ex'><mtr><mtd><mrow></mrow></mtd></mtr></mtable></mrow></mstyle></math></p>
<p><math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000'  veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><msup><mfenced open='(' close=')' separators=','><mrow><mfrac><mn>1</mn><mrow><mn>2</mn></mrow></mfrac></mrow></mfenced><mrow><mi mathvariant='normal'>$Toss</mi></mrow></msup><msup><mfenced open='(' close=')' separators=','><mrow><mn>1</mn><mo lspace='0.2222222em' rspace='0.2222222em'>&plus;</mo><mn>2</mn></mrow></mfenced><mrow><mi mathvariant='normal'>$Toss</mi></mrow></msup><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><msup><mfenced open='(' close=')' separators=','><mrow><mfrac><mn>3</mn><mrow><mn>2</mn></mrow></mfrac></mrow></mfenced><mrow><mi mathvariant='normal'>$Toss</mi></mrow></msup><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mi mathvariant='normal'>$Ans</mi></mrow></mstyle></math></p>
<p>&nbsp;You can expect to win \\$$Ans .</p>@
qu.2.6.editing=useHTML@
qu.2.6.solution=@
qu.2.6.algorithm=$Q=14;
$Toss=2+rint(5);
$Ans=decimal(2,1.5^$Toss);@
qu.2.6.uid=5a1112c2-3a4d-4ec0-b06e-2dcefea1782c@
qu.2.6.info=  Difficulty=2;
  Type=numeric;
  Course=230;
@

qu.2.7.question=<div title="UW Statistics Bank/Numerical Analysis/Measures of Centre/Expected Value/Q$Q"><img width="60" hspace="4" height="54" align="$Align" title="Table [IMG:Table.gif]" alt="Table" src="__BASE_URI__NA/MoC/ExpectedValue/Table.gif" /> In a carnival game, a quarter (radius 1 inch.) is tossed on table ruled with squares with sides "x" inches.&nbsp; If the quarter falls entirely inside a square, the player receives $1 otherwise the player loses the quarter. What must x be for this game's payoff to be \\$$PayOff (i.e. an Expected Value of $PayOffCents cents)? . (4 decimal accuracy)</div>@
qu.2.7.answer.num=$Ans@
qu.2.7.answer.units=@
qu.2.7.showUnits=false@
qu.2.7.grading=toler_abs@
qu.2.7.err=.001@
qu.2.7.negStyle=minus@
qu.2.7.numStyle=thousands scientific dollars arithmetic@
qu.2.7.mode=Numeric@
qu.2.7.name=01. Coin Toss on Table@
qu.2.7.comment=<p><img width="165" height="150" align="right" alt="Coin-in-square" src="__BASE_URI__NA/MoC/ExpectedValue/CoinInSquare.gif" title="Coin-in-square [IMG:CoinInSquare.gif]" />Let the square length be x (x>2) .  The center of the quarter falls in a given square. The probability that the quarter does not touch the sides of this square is the probability that it falls in a square of side (x-2) so the probability is <math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000' veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><mfrac><mrow><msup><mfenced open='(' close=')' separators=','><mrow><mi>x</mi><mo lspace='0.2222222em' rspace='0.2222222em'>&minus;</mo><mn>2</mn></mrow></mfenced><mrow><mn>2</mn></mrow></msup></mrow><mrow><msup><mi>x</mi><mrow><mn>2</mn></mrow></msup></mrow></mfrac></mrow></mstyle></math>  . Therefore the expected amount won or lost on a play of this game is <math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000' veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><mfrac><msup><mfenced open='(' close=')' separators=','><mrow><mi>x</mi><mo lspace='0.2222222em' rspace='0.2222222em'>&minus;</mo><mn>2</mn></mrow></mfenced><mrow><mn>2</mn></mrow></msup><mrow><msup><mi>x</mi><mrow><mn>2</mn></mrow></msup></mrow></mfrac><mo lspace='0.0em' rspace='0.0em'>&sdot;</mo><mn>1</mn><mo lspace='0.2222222em' rspace='0.2222222em'>&minus;</mo><mfenced open='(' close=')' separators=','><mrow><mn>1</mn><mo lspace='0.2222222em' rspace='0.2222222em'>&minus;</mo><mfrac><msup><mfenced open='(' close=')' separators=','><mrow><mi>x</mi><mo lspace='0.2222222em' rspace='0.2222222em'>&minus;</mo><mn>2</mn></mrow></mfenced><mrow><mn>2</mn></mrow></msup><mrow><msup><mi>x</mi><mrow><mn>2</mn></mrow></msup></mrow></mfrac></mrow></mfenced><mo lspace='0.0em' rspace='0.0em'>&sdot;</mo><mn>0.25</mn></mrow></mstyle></math></p>
<p>&nbsp;</p>
<p>Expand and simplify to get: <math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000' veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><mn>1</mn><mo lspace='0.2222222em' rspace='0.2222222em'>&minus;</mo><mfrac><mn>5</mn><mrow><mi>x</mi></mrow></mfrac><mo lspace='0.2222222em' rspace='0.2222222em'>&minus;</mo><mrow><mfrac><mn>5</mn><mrow><msup><mi>x</mi><mrow><mn>2</mn></mrow></msup></mrow></mfrac></mrow></mrow></mstyle></math>.  To find the necessary <em><font size="3" face="Times New Roman">x</font></em> to produce <font size="3" face="Times New Roman">$PayOff</font> as a payoff, set this expression equal to <font size="3" face="Times New Roman">$PayOff</font> and then solve for <em><font size="3" face="Times New Roman">x</font></em>. Some basic algebra will yield:</p>
<p><math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000'  veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><msup><mi>x</mi><mrow><mn>2</mn></mrow></msup><mo lspace='0.2222222em' rspace='0.2222222em'>&minus;</mo><mn>5</mn><mo lspace='0.0em' rspace='0.0em'>&#32;</mo><mi>x</mi><mo lspace='0.2222222em' rspace='0.2222222em'>&plus;</mo><mn>5</mn><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mo lspace='0.0em' rspace='0.0em'>&#32;</mo><mfenced open='(' close=')' separators=','><mrow><mi mathvariant='normal'>$PayOff</mi></mrow></mfenced><mo lspace='0.0em' rspace='0.0em'>&sdot;</mo><msup><mi>x</mi><mrow><mn>2</mn></mrow></msup></mrow></mstyle></math><br />
<math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000'  veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><mi mathvariant='normal'>$a</mi><msup><mi>x</mi><mrow><mn>2</mn></mrow></msup><mo lspace='0.2222222em' rspace='0.2222222em'>&minus;</mo><mn>5</mn><mo lspace='0.0em' rspace='0.0em'>&#32;</mo><mi>x</mi><mo lspace='0.2222222em' rspace='0.2222222em'>&plus;</mo><mn>5</mn><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mn>0</mn></mrow><mrow><mo lspace='0.0em' rspace='0.0em'>&#32;</mo></mrow></mstyle></math> .&nbsp;  <br />
<br />
This is a quadratic and you'll likely have to solve it using the quadratic formula: <math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000'  veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><mi>x</mi><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mrow><mfrac><mrow><mn>5</mn><mrow><mo lspace='0.0em' rspace='0.0em'>&plusmn;</mo></mrow><mrow><msqrt><mrow><mn>25</mn><mo lspace='0.2222222em' rspace='0.2222222em'>&minus;</mo><mn>4</mn><mfenced open='(' close=')' separators=','><mrow><mi mathvariant='normal'>$a</mi></mrow></mfenced><mn>5</mn></mrow></msqrt></mrow></mrow><mrow><mn>2</mn><mfenced open='(' close=')' separators=','><mrow><mi mathvariant='normal'>$a</mi></mrow></mfenced></mrow></mfrac></mrow></mrow><mrow><mo lspace='0.0em' rspace='0.0em'>&#32;</mo></mrow></mstyle></math>= <font size="3" face="Times New Roman">$Ans, $NGAns</font></p>
<p>We reject the second answer because we required <font size="3" face="Times New Roman"><em>x</em> > 2</font>.</p>@
qu.2.7.editing=useHTML@
qu.2.7.solution=@
qu.2.7.algorithm=$Q="01";
$Align=switch(rint(2),"Left","Right");
$PayOff = range(0.15,0.65,0.05);
$PayOffCents=100*$PayOff;
$a=1-$PayOff;
$Ans=decimal(4,(5+sqrt(25-20*$a))/(2*$a));
$NGAns=decimal(4,(5-sqrt(25-20*$a))/(2*$a));@
qu.2.7.uid=641e2324-a0b8-4eac-8777-0685cf6f1ea3@
qu.2.7.info=  Course=230;
  Type=numeric;
@

qu.2.8.mode=Multiple Choice@
qu.2.8.name=04b. Fair cost lottery drawing.@
qu.2.8.comment=<p>If $n tickets are sold, then for each ticket, the probabilities for winning each of the first five prizes are all <math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000' veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><mfrac><mn>1</mn><mrow><mi mathvariant='normal'>$n</mi></mrow></mfrac></mrow></mstyle></math> with a <math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000' veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><mfrac><mi mathvariant='normal'>$nt</mi><mrow><mi mathvariant='normal'>$n</mi></mrow></mfrac></mrow></mstyle></math>probability of being shut out. The expected winning, then, once a ticket has been bought, is the sum of the products of rewards with their corresponding probabilities. This gives:&nbsp;</p>
<p><math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000' veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><mi>E</mi><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mi mathvariant='normal'>$25000</mi><mo lspace='0.0em' rspace='0.0em'>&sdot;</mo><mfrac><mn>1</mn><mrow><mi mathvariant='normal'>$n</mi></mrow></mfrac><mo lspace='0.2222222em' rspace='0.2222222em'>&plus;</mo><mi mathvariant='normal'>$10000</mi><mo lspace='0.0em' rspace='0.0em'>&sdot;</mo><mfrac><mn>1</mn><mrow><mi mathvariant='normal'>$n</mi></mrow></mfrac><mo lspace='0.2222222em' rspace='0.2222222em'>&plus;</mo><mi mathvariant='normal'>$5000</mi><mo lspace='0.0em' rspace='0.0em'>&sdot;</mo><mfrac><mi mathvariant='normal'>$nt</mi><mrow><mi mathvariant='normal'>$n</mi></mrow></mfrac><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mi mathvariant='normal'>$Ans</mi></mrow></mstyle></math></p>
<p>so <font size="3" face="Times New Roman">\\$$Ans</font> seems a fair price for the lottery ticket.</p>@
qu.2.8.editing=useHTML@
qu.2.8.solution=@
qu.2.8.algorithm=$Q="04b";
$n=range(1000, 100000, 1000);
$nt=$n-5;
$Ans=decimal(2, 25000/$n+10000/$n+5000*3/$n);
$Alt1=decimal(2,range(1.1,1.9,0.01)*$Ans);
$Alt2=decimal(2,range(0.5,0.9,0.01)*$Ans);
$Alt3=decimal(2,0.5*($Ans+switch(rint(2),$Alt1,$Alt2)));@
qu.2.8.uid=7e47c704-8bb1-4087-b1c0-61750413ec92@
qu.2.8.info=  Type=MC;
  Course=230;
@
qu.2.8.question=<div title="UW Statistics Bank/Numerical Analysis/Measures of Centre/Expected Value/Q$Q">In a lottery drawing five prizes are awarded as follows: a first prize of $25,000, a second prize of $10,000, and three prizes of $5,000 each. What should be the fair cost of a ticket if&nbsp;$n tickets are sold?</div>@
qu.2.8.answer=1@
qu.2.8.choice.1=\\$$Ans@
qu.2.8.choice.2=\\$$Alt1@
qu.2.8.choice.3=\\$$Alt2@
qu.2.8.choice.4=\\$$Alt3@
qu.2.8.fixed=4@

qu.2.9.mode=Multiple Choice@
qu.2.9.name=06. Mean weight of all the people on the flight@
qu.2.9.comment=<div class="shadedDiv descriptionSpan" style="margin-top: 0px; margin-bottom: 2px">
<p>First, how much do all the people weigh?</p>
<p>Children + Men + Women =&nbsp;$ChildTotal +&nbsp;$MenTotal +&nbsp;$WomenTotal =&nbsp;$Total kg.</p>
<p>How many people on the plane? Let c = number of children, m = # men.</p>
<p>The mean weight of any group is&nbsp;<math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000' veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><mfrac><mrow><mi>Total</mi><mo lspace='0.0em' rspace='0.0em'>&#32;</mo><mi>weight</mi><mo lspace='0.0em' rspace='0.0em'>&#32;</mo><mi>of</mi><mo lspace='0.0em' rspace='0.0em'>&#32;</mo><mi>group</mi></mrow><mrow><mi>Number</mi><mo lspace='0.0em' rspace='0.0em'>&#32;</mo><mi>in</mi><mo lspace='0.0em' rspace='0.0em'>&#32;</mo><mi>group</mi></mrow></mfrac></mrow></mstyle></math> so&nbsp;<math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000' veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><mi>Number</mi><mo lspace='0.0em' rspace='0.0em'>&#32;</mo><mi>in</mi><mo lspace='0.0em' rspace='0.0em'>&#32;</mo><mi>Group</mi><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mfrac><mrow><mi>Total</mi><mo lspace='0.0em' rspace='0.0em'>&#32;</mo><mi>weight</mi><mo lspace='0.0em' rspace='0.0em'>&#32;</mo><mi>of</mi><mo lspace='0.0em' rspace='0.0em'>&#32;</mo><mi>group</mi></mrow><mrow><mi>Mean</mi><mo lspace='0.0em' rspace='0.0em'>&#32;</mo><mi>Weight</mi></mrow></mfrac></mrow></mstyle></math><br />
<br />
Thus <math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000' veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><mi>c</mi><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mfrac><mi mathvariant='normal'>$ChildTotal</mi><mrow><mi mathvariant='normal'>$ChildMean</mi></mrow></mfrac><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mi mathvariant='normal'>$Children</mi></mrow></mstyle></math>, <math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000'  veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><mi>m</mi><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mrow><mfrac><mi mathvariant='normal'>$MenTotal</mi><mrow><mi mathvariant='normal'>$MenMean</mi></mrow></mfrac></mrow></mrow><mrow><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mi mathvariant='normal'>$Men</mi></mrow></mstyle></math> and we are told there are&nbsp;$Women women. So total number of passengers is $Number and their mean weight is&nbsp;<math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000' veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><mfrac><mi mathvariant='normal'>$Total</mi><mrow><mi mathvariant='normal'>$Number</mi></mrow></mfrac><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mi mathvariant='normal'>$Ans</mi></mrow></mstyle></math> kg.</p>
</div>@
qu.2.9.editing=useHTML@
qu.2.9.solution=@
qu.2.9.algorithm=$Q=6;
$ChildMean=range(20,40);
$MenMean=range(60,100);
$WomenMean=range(40,75);
$Children=range(10,18);
$Men=range(10,20);
$Women=range(12,25);
$ChildTotal=$Children*$ChildMean;
$MenTotal=$Men*$MenMean;
$WomenTotal=$Women*$WomenMean;
$Total=$ChildTotal+$MenTotal+$WomenTotal;
$Number=$Children+$Men+$Women;
$Ans=int(0.5+$Total/$Number);
$Alt1=int($Ans+range(0.5,0.9,0.01)*(1-$Ans));
$Alt2=int(range(0.5,0.9,0.01)*$Ans);
$Alt3=int(0.5*($Ans+switch(rint(2),$Alt1,$Alt2)));
$Which=rint(5);
$Align=switch(rint(2),"Left","Right");@
qu.2.9.uid=97f852e3-da0b-439e-9862-59384c585d11@
qu.2.9.info=  Type=MC;
  Course=230;
@
qu.2.9.question=<div title="UW Statistics Bank/Numerical Analysis/Measures of Centre/Expected Value/Q$Q"><img hspace="4" align="$Align" src="__BASE_URI__NA/MoC/ExpectedValue/Plane$Which.gif" alt="Airplane" title="Airplane [IMG:Plane$Which.gif]" />On a charter flight, the mean weight of all the children aboard the plane is&nbsp;$ChildMean kg, and their total weight is $ChildTotal kg. The mean weight of all men is&nbsp;$MenMean kg, and their total weight is&nbsp;$MenTotal kg. The&nbsp;$Women women on the flight have a total weight of&nbsp;$WomenTotal kg. What is the mean weight of all the people on this flight (rounded to the nearest kilogram)?</div>@
qu.2.9.answer=1@
qu.2.9.choice.1=$Ans@
qu.2.9.choice.2=$Alt1@
qu.2.9.choice.3=$Alt2@
qu.2.9.choice.4=$Alt3@
qu.2.9.fixed=4@

qu.2.10.mode=Multiple Choice@
qu.2.10.name=05. Minimum grade to pass@
qu.2.10.comment=<div class="shadedDiv descriptionSpan" style="margin-top: 0px; margin-bottom: 2px">This is actually an "expected value" problem, but we don't need to know that to solve it. Your quiz contributes $grq% of&nbsp;$q marks =&nbsp;$qmarks marks. Your midterm adds $grm% of&nbsp;$m marks, or&nbsp;$mmarks more marks for a total of&nbsp;$tm (of&nbsp;$t possible marks). Thus you need&nbsp;$fmarks of the&nbsp;$f marks on the final, that is <math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000' veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><mfrac><mi mathvariant='normal'>$fmarks</mi><mrow><mi mathvariant='normal'>$f</mi></mrow></mfrac><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mi mathvariant='normal'>$PreAns</mi></mrow></mstyle></math> so (rounding up if necessary) $Ans% is the minimum grade needed (of those shown).</div>@
qu.2.10.editing=useHTML@
qu.2.10.solution=@
qu.2.10.algorithm=$Q=5;
$q=range(10, 25, 5);
$m=range(20, 35, 5);
$t=$q+$m;
$f=100-$q-$m;
$grq=range(80,95);
$grm=range(60,75);
$qmarks=decimal(2,$grq*$q/100);
$mmarks=decimal(2,$grm*$m/100);
$tm=$qmarks+$mmarks;
$fmarks=80-$tm;
$PreAns=decimal(3,$fmarks/$f);
$Ans=int($PreAns*100)+1;
$Alt1=int($Ans+int(range(0.25,0.75)*(100-$Ans)));
$Alt2=int(range(0.5,0.9,0.01)*$Ans);
$Alt3=int(0.5*($Ans+switch(rint(2),$Alt1,$Alt2)));@
qu.2.10.uid=e4c76b45-4e5f-4023-bd81-557a4f55a3c1@
qu.2.10.question=<div title="UW Statistics Bank/Numerical Analysis/Measures of Centre/Expected Value/Q$Q">In your first course at UW, the prof bases the course grade on one quiz, one mid-term, and one final. The quiz counts $q % and the midterm counts $m %. If your quiz was $grq% and your midterm was only $grm%, what is the minimum grade you need to score on the final to get 80% in the class?</div>@
qu.2.10.answer=1@
qu.2.10.choice.1=$Ans@
qu.2.10.choice.2=$Alt1@
qu.2.10.choice.3=$Alt2@
qu.2.10.choice.4=$Alt3@
qu.2.10.fixed=4@

qu.2.11.mode=Multiple Choice@
qu.2.11.name=26+. Pop Sales@
qu.2.11.comment=<p>Notice that Y = $Price*X .Thus:</p>
<p>E(Y) = $Price*E(X) = $Price*$EX = $EY</p>
<p>Var(Y) = ($Price)<sup>2</sup>*Var(X) = $Price2*$VarX = $VarY</p>@
qu.2.11.editing=useHTML@
qu.2.11.solution=@
qu.2.11.algorithm=$Q="26+";
$Align=switch(rint(2),"Left","Right");
$Which=rint(4);
$Price=range(0.5,0.95,0.05);
$EX=range(70,175,5);
$EY=$Price*$EX;
$Price2=$Price^2;
$VarX=range(25,$EX-40,5);
$VarY=decimal(2,$Price2*$VarX);
$EY1=$EY-range(5,0.8*$EY,1);
$VarY1=$VarY+range(4.3,22.4,0.1);
$EY2=$EY;
$VarY2=$VarY-range(4,0.8*$VarY,0.1);
$EY3=$EY+range(5,0.8*$EY,1);
$VarY3=$VarY1;
$EY4=$EY3;
$VarY4=$VarY;@
qu.2.11.uid=0725324c-7063-4012-9daa-4ac956a701f7@
qu.2.11.info=  Type=MC;
  Course=230;
@
qu.2.11.question=<div title="University of Waterloo Statistics Bank/Numerical Analysis/Measures of Centre/Expected Value/Q$Q"><img align="$Align" title="Pop Can [IMG:Can$Which.gif]" alt="Pop can" src="__BASE_URI__NA/MoC/ExpectedValue/Can$Which.gif" />Cans of soft drinks cost \\$$Price in a certain vending machine. What is the expected value and variance of daily revenue (Y) from the machine, if X, the number of cans sold per day has:
<p>E(X) = \\$$EX, and</p>
<p>Var(X) = \\$$VarX?</p>
</div>@
qu.2.11.answer=1@
qu.2.11.choice.1=E(Y) = $EY, Var(Y) = $VarY@
qu.2.11.choice.2=E(Y) = $EY1, Var(Y) = $VarY1@
qu.2.11.choice.3=E(Y) = $EY2, Var(Y) = $VarY2@
qu.2.11.choice.4=E(Y) = $EY3, Var(Y) = $VarY3@
qu.2.11.choice.5=E(Y) = $EY4, Var(Y) = $VarY4@
qu.2.11.fixed=@

qu.2.12.mode=Multiple Choice@
qu.2.12.name=21. E(Dice difference)@
qu.2.12.comment=<p>The easiest way is to list all the rolls, that gives you the probability of each (that is <math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000' veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><mfrac><mrow><mo lspace='0.0em' rspace='0.0em'>&num;</mo><mi> occurences</mi></mrow><mrow><mn>36</mn></mrow></mfrac></mrow></mstyle></math>) and from that you can calculate <font size="3" face="Times New Roman"><em>E</em>(<em>X</em>)</font>:</p>
<table cellpadding="3" border="1">
    <tbody>
        <tr>
            <td align="center"><font size="3" face="Times New Roman"><em>X</em></font></td>
            <td align="center">How?</td>
            <td align="center">#</td>
        </tr>
        <tr>
            <td align="right">0</td>
            <td>(1,1)&hellip;(6,6)</td>
            <td align="right">6</td>
        </tr>
        <tr>
            <td align="right">1</td>
            <td style="vertical-align: top;">(1,2), (2,3),..(5,6),<br />
            (6,5),..,(2,1)</td>
            <td align="right" style="vertical-align: top;">10</td>
        </tr>
        <tr>
            <td align="right" style="vertical-align: top;">2</td>
            <td style="vertical-align: top;">(1,3),(2,4),(3,5),(4,6),<br />
            (6,4),(5,3),(4,2),(3,1)</td>
            <td align="right" style="vertical-align: top;">8</td>
        </tr>
        <tr>
            <td align="right">3</td>
            <td style="vertical-align: top;">(1,4),(2,5),(3,6),<br />
            (6,3),(5,2),(4,1)</td>
            <td align="right" style="vertical-align: top;">6</td>
        </tr>
        <tr>
            <td align="right" style="vertical-align: top;">4</td>
            <td style="vertical-align: top;">(1,5),(2,6),(6,2),(5,1)</td>
            <td align="right" style="vertical-align: top;">4</td>
        </tr>
        <tr>
            <td align="right" style="vertical-align: top;">5</td>
            <td style="vertical-align: top;">(1,6),(6,1)</td>
            <td align="right" style="vertical-align: top;">2</td>
        </tr>
    </tbody>
</table>
<p><br />
<math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000' veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><mi>E</mi><mfenced open='(' close=')' separators=','><mrow><mi>X</mi></mrow></mfenced><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mfrac><mn>6</mn><mrow><mn>36</mn></mrow></mfrac><mo lspace='0.0em' rspace='0.0em'>&sdot;</mo><mn>0</mn><mo lspace='0.2222222em' rspace='0.2222222em'>&plus;</mo><mfrac><mn>10</mn><mrow><mn>36</mn></mrow></mfrac><mo lspace='0.0em' rspace='0.0em'>&sdot;</mo><mn>1</mn><mo lspace='0.2222222em' rspace='0.2222222em'>&plus;</mo><mfrac><mn>8</mn><mrow><mn>36</mn></mrow></mfrac><mo lspace='0.0em' rspace='0.0em'>&sdot;</mo><mn>2</mn><mo lspace='0.2222222em' rspace='0.2222222em'>&plus;</mo><mfrac><mn>4</mn><mrow><mn>36</mn></mrow></mfrac><mo lspace='0.0em' rspace='0.0em'>&sdot;</mo><mn>4</mn><mo lspace='0.2222222em' rspace='0.2222222em'>&plus;</mo><mfrac><mn>2</mn><mrow><mn>36</mn></mrow></mfrac><mo lspace='0.0em' rspace='0.0em'>&sdot;</mo><mn>5</mn><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mfrac><mn>70</mn><mrow><mn>36</mn></mrow></mfrac><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mn>1.944</mn></mrow></mstyle></math></p>@
qu.2.12.editing=useHTML@
qu.2.12.hint.1=There are 36 possible outcomes - why not just list them all?<br>@
qu.2.12.solution=@
qu.2.12.algorithm=$Q=21;
$Which=rint(5);
$Align=switch(rint(2),"Left","Right");
$Ans=1.944;
$Alt1=decimal(3,range(1.1,1.9,0.01)*$Ans);
$Alt2=decimal(3,range(0.5,0.9,0.01)*$Ans);
$Alt3=decimal(3,0.5*($Ans+$Alt1));
$Alt4=decimal(3,0.5*($Ans+$Alt2));@
qu.2.12.uid=899d1b51-ef87-4dc5-932d-dc66028ee085@
qu.2.12.info=  Difficulty=2;
  Keyword=expected value;
  Keyword=mean;
  Course=230;
  Type=MC;
  Algorithmic=no;
@
qu.2.12.question=<div title="UW Statistics Bank/Numerical Analysis/Measures of Centre/Expected Value/Q$Q"><img hspace="4" align="$Align" title="Two dice [IMG:2Dice$Which.gif]" alt="Imagine two dice here." src="__BASE_URI__NA/MoC/ExpectedValue/2Dice$Which.gif" />Two dice are thrown. Let <font size="3" face="Times New Roman"><em>X</em></font> = (higher-value) - (lower-value) , where <font size="3" face="Times New Roman"><em>X</em></font> = 0 if both dice show the same face. Then <font size="3" face="Times New Roman"><em>E</em>(<em>X</em>)</font> is:</div>@
qu.2.12.answer=1@
qu.2.12.choice.1=$Ans@
qu.2.12.choice.2=$Alt1@
qu.2.12.choice.3=$Alt2@
qu.2.12.choice.4=$Alt3@
qu.2.12.choice.5=$Alt4@
qu.2.12.fixed=@

qu.2.13.question=<div title="UW Statistics Bank/Numerical Analysis/Measures of Centre/Expected Value/Q$Q">Before planting a crop for the next year, a producer does a risk assessment. According to her assessment, she concludes that there are three possible net outcomes: a \\$$x1 gain, a \\$$x2 gain, or a \\$$x3 loss with probabilities $p1, $p2 and $p3 respectively. The expected profit is (2 decimals):<img hspace="4" align="$Align" title="Crop [IMG:Crop$Which.gif]" alt="Crop" src="__BASE_URI__NA/MoC/ExpectedValue/Crop$Which.gif" /></div>@
qu.2.13.answer.num=$Ans@
qu.2.13.answer.units=@
qu.2.13.showUnits=false@
qu.2.13.grading=toler_abs@
qu.2.13.err=.1@
qu.2.13.negStyle=minus@
qu.2.13.numStyle=thousands scientific dollars arithmetic@
qu.2.13.mode=Numeric@
qu.2.13.name=16. Risk assessment before planting a crop@
qu.2.13.comment=<div class="shadedDiv descriptionSpan" style="margin-top: 0px; margin-bottom: 2px">The expected profit is <font size="3" face="Times New Roman">\\$$x1($p1) + \\$$x2($p2)&nbsp; - \\$$x3($p3)&nbsp; =&nbsp; \\$$Ans</font></div>@
qu.2.13.editing=useHTML@
qu.2.13.solution=@
qu.2.13.algorithm=$Q=16;
$x1=range(5000,10000,100);
$x2=range(2000,4000,100);
$x3=range(6000,10000,100);
$p1=decimal(1,range(0.3,0.49,0.01));
$p2=decimal(1,range(0.3,0.5,0.01));
$p3=1-$p1-$p2;
$Ans=decimal(2,$x1*$p1+$x2*$p2-$x3*$p3);
$Which=rint(5);
$Align=switch(rint(2),"Left","Right");@
qu.2.13.uid=8e52de12-0c3b-429e-9455-8e1ad075c06e@
qu.2.13.info=  Course=230;
  Type=numeric;
@

qu.2.14.mode=Multiple Choice@
qu.2.14.name=07. Puzzles & Music@
qu.2.14.comment=<p>Just sum up all products of the form xP(X=x): E(X) =&nbsp;$x1*$p1 + $x2*$p2&nbsp; +&nbsp;$x3*$p3 +&nbsp;$x4*$p4 &nbsp;= $Ans</p>@
qu.2.14.editing=useHTML@
qu.2.14.solution=@
qu.2.14.algorithm=$Q=7;
$p1=decimal(2,range(0.1,0.3,0.05));
$p2=decimal(2,range(0.1,0.2,0.05));
$p3=decimal(2,range(0.3,0.5,0.05));
$p4=1-$p1-$p2-$p3;
$x1=1;
$x2=2;
$x3=3;
$x4=4;
$Ans=$x1*$p1+$x2*$p2+$x3*$p3+$x4*$p4;
$Alt1=decimal(2,range(1.1,1.9,0.01)*$Ans);
$Alt2=decimal(2,range(0.5,0.9,0.01)*$Ans);
$Alt3=decimal(2,0.5*($Ans+switch(rint(2),$Alt1,$Alt2)));@
qu.2.14.uid=42e30eec-cfc6-48f6-ae6f-65df9b222623@
qu.2.14.info=  Course=230;
  Type=MC;
@
qu.2.14.question=<div title="UW Statistics Bank/Numerical Analysis/Measures of Centre/Expected Value/Q$Q">The psychologist studied the number of puzzles subjects were able to solve in a 5 minute period while listening to soothing music. Let X be the number of puzzles completed successfully by a subject. The psychologist found that X had the following probability distribution.<br />
&nbsp;</div>
<table cellspacing="2" cellpadding="2" border="1">
    <tbody>
        <tr>
            <td>x</td>
            <td align="center">1</td>
            <td align="center">2</td>
            <td align="center">3</td>
            <td align="center">4</td>
        </tr>
        <tr>
            <td>P(X=x)</td>
            <td>$p1&nbsp;</td>
            <td>$p2&nbsp;</td>
            <td>$p3&nbsp;</td>
            <td>$p4&nbsp;</td>
        </tr>
    </tbody>
</table>
<div><br />
Using the above data, the mean &micro; of X is what?</div>@
qu.2.14.answer=1@
qu.2.14.choice.1=$Ans@
qu.2.14.choice.2=$Alt1@
qu.2.14.choice.3=$Alt2@
qu.2.14.choice.4=$Alt3@
qu.2.14.fixed=4@

qu.2.15.mode=Multiple Choice@
qu.2.15.name=20. Mean number of cartoons@
qu.2.15.comment=<p><br />
With X as the number of hours:</p>
<p>
<title></title>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0" />
<meta name="ProgId" content="FrontPage.Editor.Document" /></p>
<p><math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000'  veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><mover><mrow><mi>X</mi></mrow><mi>&minus;</mi></mover><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo></mrow><mrow><munderover><mo lspace='0.0em' rspace='0.1666667em' stretchy='true' largeop='true' movablelimits='true'>&Sum;</mo><mrow><mi mathcolor='#800080'>i</mi><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mn>1</mn></mrow><mrow><mn>6</mn></mrow></munderover><mi>P</mi><mfenced open='(' close=')' separators=','><mrow><msub><mi>X</mi><mrow><mi>i</mi></mrow></msub></mrow></mfenced><mo lspace='0.0em' rspace='0.0em'>&sdot;</mo><msub><mi>X</mi><mrow><mi>i</mi></mrow></msub></mrow><mrow><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mi>$X</mi></mrow></mstyle></math></p>@
qu.2.15.editing=useHTML@
qu.2.15.solution=@
qu.2.15.algorithm=$Q=20;
$Align=switch(rint(2),"Left","Right");
$Activity=switch(rint(2),"cartoons watched","video games played");
$Grade=switch(rint(3),"first","second","third");
$Teacher=switch(rint(5),"Mrs. Kelly","Mr. Blossom","Ms. Camber","Ms. Tambo","Mr. Blackburn");
$P0 = range(0.1,0.15,0.001);
$P1 = range(0.1,0.15,0.001);
$P2 = range(0.05,0.15,0.001);
$P3 = range(0.1,0.15,0.001);
$P4 = range(0.05,0.15,0.001);
$P5 = 1-$P0-$P1-$P2-$P3-$P4;
$X = (0*$P0)+(1*$P1)+(2*$P2)+(3*$P3)+(4*$P4)+(5*$P5);
$Ans = decimal(3,$X);
$Alt1 = decimal(3,range(0.4,0.8,0.05)*$Ans);
$Alt2 = decimal(3,range(1.1,1.5,0.05)*$Ans);
$Alt3=decimal(3,0.5*($Ans+$Alt1));
$Alt4=decimal(3,range(0.4,0.7,0.05)*($Ans+$Alt2));@
qu.2.15.uid=0571c8bd-9dbe-44ab-bd57-3f10a453e729@
qu.2.15.info=  Difficulty=2;
  Keyword=mean;
  Course=202;
  Course=230;
  Type=MC;
@
qu.2.15.question=<div title="UW Statistics Bank/Numerical Analysis/Measures of Centre/Expected Value/Q$Q"><img hspace="4" align="absMiddle" src="__BASE_URI__NA/MoC/ExpectedValue/VideoKid.gif" title="Video Kid [IMG:VideoKid.gif]" alt="Video Kid" />The number of $Activity by $Teacher's $Grade grade class on Saturday morning is shown below.<br />
<div align="center"><center>
<table cellspacing="4" cellpadding="2" bordercolor="#111111" border="1" style="border-collapse: collapse;">
    <tbody>
        <tr>
            <td>
            <p align="center"><em>x</em></p>
            </td>
            <td>
            <p align="center"><em>P(x)</em></p>
            </td>
            <td>
            <p align="center"><em>x</em></p>
            </td>
            <td>
            <p align="center"><em>P(x)</em></p>
            </td>
        </tr>
        <tr>
            <td align="center">0</td>
            <td align="center">$P0</td>
            <td align="center">3</td>
            <td align="center">$P3</td>
        </tr>
        <tr>
            <td align="center">1</td>
            <td align="center">$P1</td>
            <td align="center">4</td>
            <td align="center">$P4</td>
        </tr>
        <tr>
            <td align="center">2</td>
            <td align="center">$P2</td>
            <td align="center">5</td>
            <td align="center">$P5</td>
        </tr>
    </tbody>
</table>
</center></div>
<p>What is the mean for the probability distribution above?</p>
</div>@
qu.2.15.answer=1@
qu.2.15.choice.1=$Ans@
qu.2.15.choice.2=$Alt1@
qu.2.15.choice.3=$Alt2@
qu.2.15.choice.4=$Alt3@
qu.2.15.choice.5=$Alt4@
qu.2.15.fixed=@

qu.2.16.question=<div title="UW Statistics Bank/Numerical Analysis/Measures of Centre/Expected Value/Q$Q">A restaurant manager is considering a new location for her restaurant. The projected annual cash flow for the new location is: <br />
<br />
<table cellspacing="2" cellpadding="2" border="1">
    <tbody>
        <tr>
            <td>Annual Cash Flow ($000)</td>
            <td>$C1</td>
            <td>$C2</td>
            <td>$C3</td>
            <td>$C4</td>
            <td>$C5</td>
        </tr>
        <tr>
            <td>Probability</td>
            <td align="right">$P1</td>
            <td align="right">$P2</td>
            <td align="right">$P3</td>
            <td align="right">$P4</td>
            <td align="right">?</td>
        </tr>
    </tbody>
</table>
<br />
<br />
The expected cash flow for the new location is (4 decimals):</div>@
qu.2.16.answer.num=$Ans@
qu.2.16.answer.units=@
qu.2.16.showUnits=false@
qu.2.16.grading=toler_abs@
qu.2.16.err=.001@
qu.2.16.negStyle=minus@
qu.2.16.numStyle=thousands scientific dollars arithmetic@
qu.2.16.mode=Numeric@
qu.2.16.name=10. Cash Flow Restaurant@
qu.2.16.comment=<p>The expected cash flow for the new location is:<br />
<br />
Expected Cash Flow =&sum; P(each event)Value(each event)</p>
<p>= \\$1,000*($P1($C1) + $P2*($C2) + $P3*($C3) + $P4*($C4) + $P5*($C5) )= \\$$Ans</p>@
qu.2.16.editing=useHTML@
qu.2.16.solution=@
qu.2.16.algorithm=$Q=10;
$C5=10*(rint(40)+10);
$C4=10*int(4*$C5/50)+10*rint($C5/50);
$C3=10*int(3*$C4/40)+10*rint($C4/40);
$C2=10*int(2*$C3/30)+10*rint($C3/30);
$C1=10$int($C2/20)+10*rint($C2/20);
$P1=decimal(2,range(0.05,0.40,0.05));
$P2=decimal(2,range(0.05,0.60-$P1,0.05));
$P3=decimal(2,range(0.05,0.70-$P1-$P2,0.05));
$P4=decimal(2,range(0.05,0.90-$P1-$P2-$P3,0.05));
$P5=decimal(2,1-($P1+$P2+$P3+$P4));
$Ans=1000*($P1*$C1+$P2*$C2+$P3*$C3+$P4*$C4+$P5*$C5);@
qu.2.16.uid=226782fb-5d8e-4917-bc6d-1a29d45a77cb@
qu.2.16.info=  Difficulty=2;
  Course=230;
  Keyword=expected value;
  Type=numeric;
@

qu.2.17.mode=Multiple Choice@
qu.2.17.name=11. Insurance on boat/trailer/etc.@
qu.2.17.comment=<p>First calculate the expected payout. Notice that P(no damage) = 1 - $PTotal - $PSupThresh-$PSubThresh = $PNil.<br />
<br />
Expected Payout = .$PTotal($RCost) + $PSupThresh($LPay) + $PSubThresh(0) + $PNil(0) = \\$$EPayOut, so charge \\$$EPayOut + \\$$Profit = \\$$Premium.</p>@
qu.2.17.editing=useHTML@
qu.2.17.solution=@
qu.2.17.algorithm=$Q=11;
$Pick=rint(4);
$Insured=switch($Pick,"small boat","camping trailer","horse-drawn buggy","horse trailer");
$ImgIs=switch($Pick,"Boat","Trailer","Buggy","Horse");
$Align=switch(rint(2),"Left","Right");
$RCost=1000*(3+rint(15));
$LThresh=1000*int(range(0.4,0.7,0.05)*$RCost/1000);
$LPay=100*int(range(0.65,0.95,0.05)*$LThresh/100);
$Profit=10*(5+rint(6));
$PTotal=range(0.01,0.10,0.01);
$PSupThresh=range($PTotal,0.20,0.01);
$PSubThresh=range(0.25,0.45,0.01);
$PNil=1-$PTotal-$PSupThresh-$PSubThresh;
$EPayOut=$PTotal*$RCost+$PSupThresh*$LPay;
$Premium=$EPayOut+$Profit;
$Alt1=int(range(0.25,0.75,0.05)*$Premium);
$Alt2=int(range(1.15,1.55,0.05)*$Premium);
$Alt3=int(0.5*($Premium+switch(rint(2),$Alt1,$Alt2)));@
qu.2.17.uid=8c0ddd67-5bae-4210-a5a1-c15fde0e0fbb@
qu.2.17.info=  Course=230;
  Type=MC;
@
qu.2.17.question=<div title="UW Statistics Bank/Numerical Analysis/Measures of Centre/Expected Value/Q$Q"><img hspace="4" align="$Align" alt="$Insured" title="$Insured [IMG:Insure18$ImgIs.gif]" src="__BASE_URI__NA/MoC/ExpectedValue/Insure$ImgIs.gif" />An insurance company issues a policy on a $Insured under the following conditions: The replacement cost (\\$$RCost) will be paid for a total loss. If it is not a total loss, but the damage is more than \\$$LThresh, then \\$$LPay will be paid. Nothing will be paid for damage costing \\$$LThresh or less and of course nothing is paid out if there is no damage. The company estimates the probability of the first three events as $PTotal, $PSupThresh, and $PSubThresh respectively. The amount the company should charge if it wishes to make a profit of \\$$Profit above the expected amount paid out in a year is:</div>@
qu.2.17.answer=1@
qu.2.17.choice.1=\\$$Premium@
qu.2.17.choice.2=\\$$Alt1@
qu.2.17.choice.3=\\$$Alt2@
qu.2.17.choice.4=\\$$Alt3@
qu.2.17.fixed=@

qu.2.18.mode=True False@
qu.2.18.name=22. Can X never = E(X)?@
qu.2.18.comment=<p>Yes, most definitely! As a simple example think of rolling a die. There are 6 equally probable outcomes and the Expected value is just <math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000' veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><mfrac><mrow><mn>1</mn><mo lspace='0.2222222em' rspace='0.2222222em'>&amp;plus;</mo><mn>2</mn><mo lspace='0.2222222em' rspace='0.2222222em'>&amp;plus;</mo><mn>3</mn><mo lspace='0.2222222em' rspace='0.2222222em'>&amp;plus;</mo><mn>4</mn><mo lspace='0.2222222em' rspace='0.2222222em'>&amp;plus;</mo><mn>5</mn><mo lspace='0.2222222em' rspace='0.2222222em'>&amp;plus;</mo><mn>6</mn></mrow><mrow><mn>6</mn></mrow></mfrac><mo lspace='0.2777778em' rspace='0.2777778em'>&amp;equals;</mo><mfrac><mn>21</mn><mrow><mn>6</mn></mrow></mfrac><mo lspace='0.2777778em' rspace='0.2777778em'>&amp;equals;</mo><mn>3.5</mn></mrow></mstyle></math>, a value the dice can never take on.</p>@
qu.2.18.editing=useHTML@
qu.2.18.solution=@
qu.2.18.algorithm=@
qu.2.18.uid=dfe97e6e-0b2c-48dd-94a4-eb88bcc6672f@
qu.2.18.info=  Difficulty=1;
  Keyword=expected value;
  Keyword=mean;
  Course=230;
  Course=202;
  Algorithmic=no;
  Type=TF;
@
qu.2.18.question=<div title="UW Statistics Bank/Numerical Analysis/Measures of Centre/Expected Value/Q22">
It is possible for the Expected Value of a random variable to be some value that the random variable can never take on? (That is, it is possible that for some random variable X, X &ne; E(X) always?)</div>@
qu.2.18.answer=1@
qu.2.18.choice.1=True@
qu.2.18.choice.2=False@
qu.2.18.fixed=@

qu.2.19.question=<div title="UW Statistics Bank/Numerical Analysis/Measures of Centre/Expected Value/Q$Q">Find the mean of the distribution shown. (3 decimals)<br />
&nbsp;<br />
<div align="center"><center>
<table width="200" cellspacing="5" bordercolor="#111111" border="0" id="AutoNumber1" style="border-collapse: collapse;">
    <tbody>
        <tr>
            <td>x</td>
            <td align="center">$X1</td>
            <td align="center">$X2</td>
            <td align="center">$X3</td>
        </tr>
        <tr>
            <td>P(x)</td>
            <td align="center">$P1</td>
            <td align="center">$P2</td>
            <td align="center">$P3</td>
        </tr>
    </tbody>
</table>
</center></div>
</div>@
qu.2.19.answer.num=$Ans@
qu.2.19.answer.units=@
qu.2.19.showUnits=false@
qu.2.19.grading=toler_abs@
qu.2.19.err=.01@
qu.2.19.negStyle=minus@
qu.2.19.numStyle=thousands scientific dollars arithmetic@
qu.2.19.mode=Numeric@
qu.2.19.name=19. Find the mean@
qu.2.19.comment=<p>The mean is, of course, <math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000' veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><munderover><mo lspace='0.0em' rspace='0.1666667em' stretchy='true' largeop='true' movablelimits='true'>&Sum;</mo><mrow><mi mathcolor='#800080'>i</mi></mrow><mi></mi></munderover><msub><mi>X</mi><mrow><mi>i</mi></mrow></msub><mo lspace='0.0em' rspace='0.0em'>&sdot;</mo><mi>P</mi><mfenced open='(' close=')' separators=','><mrow><msub><mi>X</mi><mrow><mi>i</mi></mrow></msub></mrow></mfenced></mrow></mstyle></math> which in this case is $X1($P1)+$X2($P2)+$X3($P3) = $Ans.</p>@
qu.2.19.editing=useHTML@
qu.2.19.solution=@
qu.2.19.algorithm=$Q=19;
$X1=range(1,5);
$X2=$X1+1;
$X3=$X2+1;
$P1=range(0.15,0.45,0.01);
$P2=range(0.15,0.85-$P1,0.01);
$P3=1-$P1-$P2;
$Ans=$X1*$P1+$X2*$P2+$X3*$P3;
$Alt1=range($X1,0.95*$Ans,0.01);
$Alt2=range($Ans+0.01,$X3,0.01);
$Alt3=$Alt2+range(.1,.5,0.01);@
qu.2.19.uid=4fd6b737-e23b-4fd0-be70-6c49eb3c0fb7@
qu.2.19.info=  Difficulty=1;
  Keyword=mean;
  Course=202;
  Course=230;
  Type=numeric;
@

qu.2.20.mode=Multiple Choice@
qu.2.20.name=18. Mean # fails@
qu.2.20.comment=<p>Mean = (Failure Rate)(Number writing) = <math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000'  veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><mfrac><mi mathvariant='normal'>$FailPC</mi><mrow><mn>100</mn></mrow></mfrac><mo lspace='0.0em' rspace='0.0em'>&sdot;</mo><mi mathvariant='normal'>$NumTakers</mi><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mi mathvariant='normal'>$Ans</mi></mrow></mstyle></math>(rounded off to the nearest integer).</p>@
qu.2.20.editing=useHTML@
qu.2.20.solution=@
qu.2.20.algorithm=$Q=18;
$City=switch(rint(4),"Ottawa","Toronto","Vancouver","Windsor");
$FailPC=range(20,45,1);
$NumTakers=range(225,675,5);
$Ans=int(0.5+$FailPC*$NumTakers/100);
$Alt1=$Ans+int(range(0.2,0.4,0.05)*($NumTakers-$Ans));
$Alt2=int(range(0.65,0.95,0.05)*$Ans);
$Alt3=int(0.5*switch(rint(2),$Alt1+$Ans,$Alt2+$Ans));@
qu.2.20.uid=0d21dd34-e1b9-4102-86fd-259224f3035c@
qu.2.20.info=  Difficulty=1;
  Keyword=mean;
  Course=202;
  Type=MC;
@
qu.2.20.question=<div title="UW Statistics Bank/Numerical Analysis/Measures of Centre/Expected Value/Q$Q">The failure rate for taking the bar exam in $City is $FailPC%. If $NumTakers people take the bar exam, what is the mean for the number of failures?</div>@
qu.2.20.answer=4@
qu.2.20.choice.1=$Alt1@
qu.2.20.choice.2=$Alt2@
qu.2.20.choice.3=$Alt3@
qu.2.20.choice.4=$Ans@
qu.2.20.fixed=@

qu.2.21.question=<div title="UW Statistics Bank/Numerical Analysis/Measures of Centre/Expected Value/Q$Q"><img hspace="4" align="$Align" src="__BASE_URI__NA/MoC/ExpectedValue/Car$Which.gif" alt="Car" title="Car [IMG:Car$Which.gif]" />An insurance company has estimated the following cost probabilities for the next year on a particular model of car:  <br />
<br />
<table cellspacing="2" cellpadding="2" border="1">
    <tbody>
        <tr>
            <td>Insurance payout (\\$)</td>
            <td align="center">$C1</td>
            <td align="center">$C2</td>
            <td align="center">$C3</td>
            <td align="center">$C4</td>
        </tr>
        <tr>
            <td>Probability</td>
            <td align="center">$P1</td>
            <td align="center">$P2</td>
            <td align="center">$P3</td>
            <td align="center">$P4</td>
        </tr>
    </tbody>
</table>
<br />
<br />
The expected cash flow for the new model is:</div>@
qu.2.21.answer.num=$Ans@
qu.2.21.answer.units=@
qu.2.21.showUnits=false@
qu.2.21.grading=toler_abs@
qu.2.21.err=.001@
qu.2.21.negStyle=minus@
qu.2.21.numStyle=thousands scientific dollars arithmetic@
qu.2.21.mode=Numeric@
qu.2.21.name=13. Car Insurance@
qu.2.21.comment=<p>The expected payout is:<br />
<br />
=&sum; P(each payout)Value(each payout)</p>
<p>= \\$($P1($C1) + $P2*($C2) + $P3*($C3) + $P4*($C4) )= \\$$Ans</p>@
qu.2.21.editing=useHTML@
qu.2.21.solution=@
qu.2.21.algorithm=$Q=13;
$C4=range(3000,5200,100);
$C3=range(1000,1550,10);
$C2=range(400,800,25);
$C1=0;
$P1=decimal(2,range(0.55,0.75,0.05));
$P2=decimal(2,range(0.05,0.80-$P1,0.05));
$P3=decimal(2,range(0.05,0.90-$P1-$P2,0.05));
$P4=decimal(2,1-($P1+$P2+$P3));
$Ans=($P1*$C1+$P2*$C2+$P3*$C3+$P4*$C4);
$Which=rint(5);
$Align=switch(rint(2),"Left","Right");@
qu.2.21.uid=efb85c49-e44e-48a8-aa3c-f6907d92d3e1@
qu.2.21.info=  Difficulty=2;
  Course=230;
  Type=numeric;
@

qu.2.22.question=<div title="UW Statistics Bank/Numerical Analysis/Measures of Centre/Expected Value/Q$Q">In a lottery drawing five prizes are awarded as follows: a first prize of $25,000, a second prize of $10,000, and three prizes of $5,000 each. What should be the fair cost of a ticket if $n tickets are sold? (2 decimals, do NOT include \\$ in your answer!)</div>@
qu.2.22.answer.num=$Ans@
qu.2.22.answer.units=@
qu.2.22.showUnits=false@
qu.2.22.grading=toler_abs@
qu.2.22.err=.1@
qu.2.22.negStyle=minus@
qu.2.22.numStyle=thousands scientific dollars arithmetic@
qu.2.22.mode=Numeric@
qu.2.22.name=04a. Fair cost lottery drawing.@
qu.2.22.comment=<p>If $n tickets are sold, then for each ticket, the probabilities for winning each of the first five prizes are all <math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000' veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><mfrac><mn>1</mn><mrow><mi mathvariant='normal'>$n</mi></mrow></mfrac></mrow></mstyle></math> with a <math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000' veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><mfrac><mi mathvariant='normal'>$nt</mi><mrow><mi mathvariant='normal'>$n</mi></mrow></mfrac></mrow></mstyle></math>probability of being shut out. The expected winning, then, once a ticket has been bought, is the sum of the products of rewards with their corresponding probabilities. This gives:&nbsp;</p>
<p><math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000' veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><mi>E</mi><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mi mathvariant='normal'>$25000</mi><mo lspace='0.0em' rspace='0.0em'>&sdot;</mo><mfrac><mn>1</mn><mrow><mi mathvariant='normal'>$n</mi></mrow></mfrac><mo lspace='0.2222222em' rspace='0.2222222em'>&plus;</mo><mi mathvariant='normal'>$10000</mi><mo lspace='0.0em' rspace='0.0em'>&sdot;</mo><mfrac><mn>1</mn><mrow><mi mathvariant='normal'>$n</mi></mrow></mfrac><mo lspace='0.2222222em' rspace='0.2222222em'>&plus;</mo><mi mathvariant='normal'>$5000</mi><mo lspace='0.0em' rspace='0.0em'>&sdot;</mo><mfrac><mi mathvariant='normal'>$nt</mi><mrow><mi mathvariant='normal'>$n</mi></mrow></mfrac><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mi mathvariant='normal'>$Ans</mi></mrow></mstyle></math></p>
<p>so <font size="3" face="Times New Roman">\\$$Ans</font> seems a fair price for the lottery ticket.</p>@
qu.2.22.editing=useHTML@
qu.2.22.solution=@
qu.2.22.algorithm=$Q="04a";
$n=range(1000, 100000, 1000);
$nt=$n-5;
$Ans=decimal(2, 25000/$n+10000/$n+5000*3/$n);@
qu.2.22.uid=2d6e0d28-e6ee-4be9-a93b-2cfd6fc830bc@
qu.2.22.info=  Type=numeric;
  Course=230;
@

qu.2.23.mode=Multiple Choice@
qu.2.23.name=17b. Business proposal@
qu.2.23.comment=<p>The expected profit in dollars is ($p1)(\\$$x1) + ($p2)(\\$$x2) + ($p3)(\\$$x3)&nbsp; + ($p4)(-\\$$x4)&nbsp; = \\$$Ans</p>@
qu.2.23.editing=useHTML@
qu.2.23.solution=@
qu.2.23.algorithm=$Q="17b";
$x1=range(5000,15000,75);
$x2=range(1000,5000, 65);
$x3=0;
$x4=$x2;
$p1=decimal(2,range(0.05,0.15,0.01));
$p2=decimal(2,range(0.3,0.5,0.01));
$p3=decimal(2,range(0.2,0.3,0.01));
$p4=1-$p1-$p2-$p3;
$Ans=numfmt("#.00",$x1*$p1+$x2*$p2+$x3*$p3-$x4*$p4);
$Alt1=numfmt("#.00", range(1.1,1.9,0.01)*$Ans);
$Alt2=numfmt("#.00", range(0.5,0.9,0.01)*$Ans);
$Alt3=numfmt("#.00", 0.5*($Ans+$Alt1));
$Alt4=numfmt("#.00", 0.5*($Ans+$Alt2));@
qu.2.23.uid=9e95fe8e-e7f3-4b59-8413-cab898fdd76e@
qu.2.23.info=  Course=230;
  Type=MC;
@
qu.2.23.question=<div title="UW Statistics Bank/Numerical Analysis/Measures of Centre/Expected Value/Q$Q">A business evaluates a proposed venture as follows. It stands to make a profit of \\$$x1 with probability $p1, to make a profit of \\$$x2 with probability&nbsp;$p2 to break even with probability&nbsp;$p3 and to lose \\$$x4 with probability $p4. The expected profit is:</div>@
qu.2.23.answer=1@
qu.2.23.choice.1=\\$$Ans@
qu.2.23.choice.2=\\$$Alt1@
qu.2.23.choice.3=\\$$Alt2@
qu.2.23.choice.4=\\$$Alt3@
qu.2.23.choice.5=\\$$Alt4@
qu.2.23.fixed=4@

qu.2.24.mode=Multiple Choice@
qu.2.24.name=03. Average stay in hospital@
qu.2.24.comment=<p>Let <em><font size="3" face="Times New Roman">p<sub>n</sub></font></em> be the probabilty of staying <em><font size="3" face="Times New Roman">n</font></em> days, <font size="3" face="Times New Roman"><em>n</em> = 2,..,6</font>.</p>
<p>Then <font size="3" face="Times New Roman"><em>p</em><sub>6</sub></font> =&nbsp;<math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000'  veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><mn>1</mn><mo lspace='0.2222222em' rspace='0.2222222em'>&minus;</mo><munderover><mo lspace='0.0em' rspace='0.1666667em' stretchy='true' largeop='true' movablelimits='true'>&Sum;</mo><mrow><mi>n</mi><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mn>2</mn></mrow><mrow><mn>5</mn></mrow></munderover><msub><mi>p</mi><mrow><mi>n</mi></mrow></msub><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mi mathvariant='normal'>$p6</mi></mrow></mstyle></math></p>
<p>The average length of stay is: <math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000' veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><munderover><mo lspace='0.0em' rspace='0.1666667em' stretchy='true' largeop='true' movablelimits='true'>&Sum;</mo><mrow><mi>n</mi><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mn>2</mn></mrow><mrow><mn>6</mn></mrow></munderover><mi>n</mi><mo lspace='0.0em' rspace='0.0em'>&sdot;</mo><msub><mi>p</mi><mrow><mi>n</mi></mrow></msub><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mi mathvariant='normal'>$Ans</mi></mrow></mstyle></math></p>@
qu.2.24.editing=useHTML@
qu.2.24.solution=@
qu.2.24.algorithm=$Q=3;
$p2=decimal(2,range(0.1,0.3,0.01));
$p3=decimal(2,range(0.05,0.4,0.01));
$p4=decimal(2,range(0.1,0.3,0.01));
$p5=decimal(2,range(0.05,0.2,0.01));
$p6=1-$p2-$p3-$p4-$p5;
condition:gt($p6,0);
$Ans=decimal(1,2*$p2+3*$p3+4*$p4+5*$p5+6*$p6);
$Alt1=decimal(1,range(1.1,1.9,0.01)*$Ans);
$Alt2=decimal(1,range(0.5,0.9,0.01)*$Ans);
$Alt3=decimal(1,0.5*($Ans+switch(rint(2),$Alt1,$Alt2)));@
qu.2.24.uid=60bbd851-7459-498d-b453-86fab170a4b6@
qu.2.24.question=<div title="UW Statistics Bank/Numerical Analysis/Measures of Centre/Expected Value/Q$Q">The average length of stay in a hospital is useful for planning purposes. Suppose that the following is the distribution of the length of stay in a hospital after a minor operation: <br />
<br />
<table cellspacing="0" cellpadding="3" border="1">
    <tbody>
        <tr>
            <td>Days&nbsp;</td>
            <td align="center">2</td>
            <td align="center">3</td>
            <td align="center">4</td>
            <td align="center">5</td>
            <td align="center">6</td>
        </tr>
        <tr>
            <td>Probability</td>
            <td align="center">$p2&nbsp;&nbsp;</td>
            <td align="center">$p3&nbsp;&nbsp;</td>
            <td align="center">$p4 &nbsp;</td>
            <td align="center">$p5&nbsp;</td>
            <td align="center">???</td>
        </tr>
    </tbody>
</table>
<br />
The average length of stay is:</div>@
qu.2.24.answer=1@
qu.2.24.choice.1=$Ans@
qu.2.24.choice.2=$Alt1@
qu.2.24.choice.3=$Alt2@
qu.2.24.choice.4=$Alt3@
qu.2.24.fixed=4@

qu.2.25.question=<div title="UW Statistics Bank/Numerical Analysis/Measures of Centre/Expected Value/Q$Q">A business evaluates a proposed venture as follows. It stands to make a profit of \\$$x1 with probability $p1, to make a profit of \\$$x2 with probability&nbsp;$p2 to break even with probability&nbsp;$p3 and to lose \\$$x4 with probability $p4. The expected profit (2 decimals) is:</div>@
qu.2.25.answer.num=$Ans@
qu.2.25.answer.units=@
qu.2.25.showUnits=false@
qu.2.25.grading=toler_abs@
qu.2.25.err=.1@
qu.2.25.negStyle=minus@
qu.2.25.numStyle=thousands scientific dollars arithmetic@
qu.2.25.mode=Numeric@
qu.2.25.name=17a. Business proposal@
qu.2.25.comment=<p>The expected profit in dollars is ($p1)(\\$$x1) + ($p2)(\\$$x2) + ($p3)(\\$$x3)&nbsp; + ($p4)(-\\$$x4)&nbsp; = \\$$Ans</p>@
qu.2.25.editing=useHTML@
qu.2.25.solution=@
qu.2.25.algorithm=$Q="17a";
$x1=range(5000,15000,75);
$x2=range(1000,5000, 65);
$x3=0;
$x4=$x2;
$p1=decimal(2,range(0.05,0.15,0.01));
$p2=decimal(2,range(0.3,0.5,0.01));
$p3=decimal(2,range(0.2,0.3,0.01));
$p4=1-$p1-$p2-$p3;
$Ans=numfmt("#.00",$x1*$p1+$x2*$p2+$x3*$p3-$x4*$p4);@
qu.2.25.uid=1efdb61d-93ee-4380-8a77-8c003ee71e3f@
qu.2.25.info=  Course=230;
  Type=numeric;
@

qu.2.26.mode=Multiple Choice@
qu.2.26.name=15. Expected value of a r.v@
qu.2.26.comment=<p><math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000' veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><mi>E</mi><mfenced open='(' close=')' separators=','><mrow><mi>X</mi></mrow></mfenced><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><munderover><mo lspace='0.0em' rspace='0.1666667em' stretchy='true' largeop='true' movablelimits='true'>&Sum;</mo><mrow><mi>x</mi><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mn>0</mn></mrow><mrow><mn>5</mn></mrow></munderover><mi>x</mi><mo lspace='0.0em' rspace='0.0em'>&sdot;</mo><mi>P</mi><mfenced open='(' close=')' separators=','><mrow><mi>X</mi><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mi>x</mi></mrow></mfenced></mrow></mstyle></math> = $x0($p0)&nbsp; + $x1($p1) + $x2($p2)&nbsp; + $x3($p3)&nbsp; + $x4($p4) + $x5($p5)&nbsp; = $Ans</p>@
qu.2.26.editing=useHTML@
qu.2.26.solution=@
qu.2.26.algorithm=$Q=15;
$x0=0;
$x1=1;
$x2=2;
$x3=3;
$x4=4;
$x5=5;
$p0=decimal(2,range(0,0.2,0.01));
$p1=decimal(2,range(0,0.2,0.01));
$p2=decimal(2,range(0,0.2,0.01));
$p3=decimal(2,range(0,0.2,0.01));
$p4=decimal(2,range(0,0.2,0.01));
$p5=1-$p0-$p1-$p2-$p3-$p4;
$Ans=decimal(2, $x0($p0)  + $x1($p1) + $x2($p2)  + $x3($p3)  + $x4($p4) + $x5($p5));
$Alt1=decimal(2,range(1.1,1.9,0.01)*$Ans);
$Alt2=decimal(2,range(0.5,0.9,0.01)*$Ans);
$Alt3=decimal(2,0.5*($Ans+switch(rint(2),$Alt1,$Alt2)));@
qu.2.26.uid=6147eb15-9f81-458e-8603-23b94fdf3fb3@
qu.2.26.info=  Course=230;
  Type=MC;
@
qu.2.26.question=<div title="UW Statistics Bank/Numerical Analysis/Measures of Centre/Expected Value/Q$Q">Consider the following probability distribution for a random variable X:<br />
<br />
<table cellspacing="3" cellpadding="2" border="1">
    <tbody>
        <tr>
            <td><strong>x</strong></td>
            <td align="center">0</td>
            <td align="center">1</td>
            <td align="center">2</td>
            <td align="center">3</td>
            <td align="center">4</td>
            <td align="center">5</td>
        </tr>
        <tr>
            <td><strong>P(X=x)</strong></td>
            <td align="center">$p0&nbsp;&nbsp;&nbsp;</td>
            <td align="center">$p1&nbsp;&nbsp;</td>
            <td align="center">$p2&nbsp;&nbsp;</td>
            <td align="center">$p3&nbsp;&nbsp;</td>
            <td align="center">$p4&nbsp;&nbsp;</td>
            <td align="center">$p5&nbsp;&nbsp;</td>
        </tr>
    </tbody>
</table>
<br />
Find E(X).</div>@
qu.2.26.answer=1@
qu.2.26.choice.1=$Ans@
qu.2.26.choice.2=$Alt1@
qu.2.26.choice.3=$Alt2@
qu.2.26.choice.4=$Alt3@
qu.2.26.fixed=4@

qu.2.27.mode=Inline@
qu.2.27.name=25+. Average of scales@
qu.2.27.comment=<p><br />
Using E(aX + bY) = aE(X) + bE(Y) we get <br />
&nbsp;<br />
<math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000' veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><mi>E</mi><mfenced open='(' close=')' separators=','><mrow><mfrac><mrow><mi>X</mi><mo lspace='0.2222222em' rspace='0.2222222em'>&plus;</mo><mi>Y</mi></mrow><mrow><mn>2</mn></mrow></mfrac></mrow></mfenced><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mfrac><mrow><mi>E</mi><mfenced open='(' close=')' separators=','><mrow><mi>X</mi></mrow></mfenced></mrow><mrow><mn>2</mn></mrow></mfrac><mo lspace='0.2222222em' rspace='0.2222222em'>&plus;</mo><mfrac><mrow><mi>E</mi><mfenced open='(' close=')' separators=','><mrow><mi>Y</mi></mrow></mfenced></mrow><mrow><mn>2</mn></mrow></mfrac><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mfrac><mrow><mi>E</mi><mfenced open='(' close=')' separators=','><mrow><mi>X</mi></mrow></mfenced><mo lspace='0.2222222em' rspace='0.2222222em'>&plus;</mo><mi>E</mi><mfenced open='(' close=')' separators=','><mrow><mi>Y</mi></mrow></mfenced></mrow><mrow><mn>2</mn></mrow></mfrac><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mfrac><mrow><mi mathvariant='normal'>$EX</mi><mo lspace='0.2222222em' rspace='0.2222222em'>&plus;</mo><mi mathvariant='normal'>$EY</mi></mrow><mrow><mn>2</mn></mrow></mfrac><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mi mathvariant='normal'>$AnsMean</mi></mrow></mstyle></math>g.&nbsp;</p>
<p>Now recall that Var(x) = [SD(x)]<sup>2</sup> and Var(aX + bY) = a<sup>2</sup>Var(X) + b<sup>2</sup>Var(Y) + 2abCov(X, Y)</p>
<p>Here X and Y are independent, so Cov(X, Y) = 0 and we have:</p>
<p><math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000' veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><mi>Var</mi><mfenced open='(' close=')' separators=','><mrow><mfrac><mrow><mi>X</mi><mo lspace='0.2222222em' rspace='0.2222222em'>&plus;</mo><mi>Y</mi></mrow><mrow><mn>2</mn></mrow></mfrac></mrow></mfenced><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mfrac><mn>1</mn><mrow><mn>4</mn></mrow></mfrac><mi>Var</mi><mfenced open='(' close=')' separators=','><mrow><mi>X</mi></mrow></mfenced><mo lspace='0.2222222em' rspace='0.2222222em'>&plus;</mo><mfrac><mn>1</mn><mrow><mn>4</mn></mrow></mfrac><mi>Var</mi><mfenced open='(' close=')' separators=','><mrow><mi>Y</mi></mrow></mfenced></mrow></mstyle></math> so&nbsp;<math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000'  veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><mi>SD</mi><mfenced open='(' close=')' separators=','><mrow><mfrac><mrow><mi>X</mi><mo lspace='0.2222222em' rspace='0.2222222em'>&plus;</mo><mi>Y</mi></mrow><mrow><mn>2</mn></mrow></mfrac></mrow></mfenced><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><msqrt><mrow><mfrac><mn>1</mn><mrow><mn>4</mn></mrow></mfrac><mrow><mfenced open='(' close=')' separators=','><mrow><mi mathvariant='normal'>$TX</mi><mo lspace='0.2222222em' rspace='0.2222222em'>&times;</mo><msup><mn>10</mn><mrow><mo lspace='0.2222222em' rspace='0.2222222em'>&minus;</mo><mi mathvariant='normal'>$NX</mi></mrow></msup></mrow></mfenced></mrow><mo lspace='0.2222222em' rspace='0.2222222em'>&plus;</mo><mfrac><mn>1</mn><mrow><mn>4</mn></mrow></mfrac><mrow><mfenced open='(' close=')' separators=','><mrow><mi mathvariant='normal'>$TY</mi><mo lspace='0.2222222em' rspace='0.2222222em'>&times;</mo><msup><mn>10</mn><mrow><mo lspace='0.2222222em' rspace='0.2222222em'>&minus;</mo><mi mathvariant='normal'>$NY</mi></mrow></msup></mrow></mfenced></mrow></mrow></msqrt><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mi mathvariant='normal'>$AnsSD</mi></mrow></mstyle></math></p>@
qu.2.27.editing=useHTML@
qu.2.27.solution=@
qu.2.27.algorithm=$Q = "25+";
$EX=decimal(3,range(1.97,2.02,0.01));
$EY=decimal(3,range(2.03,2.06,0.01));
$AnsMean=($EY+$EX)/2;
$stdevX=decimal(3,range(.001,.002,.0005));
$stdevY=decimal(3,range(.003,.005,.0005));
$VarX=$stdevX*$stdevX;
$VarY=$stdevY*$stdevY;
$NX=if(ge($VarX,10^-5),5,6);
$NY=if(ge($VarY,10^-5),5,6);
$TX=$VarX*10^$NX;
$TY=$VarY*10^$NY;
$AnsSD=decimal(4,sqrt($VarX+$VarY)/2);
$Which=rint(5);
$Align=switch(rint(2),"Left","Right");@
qu.2.27.uid=7b64e843-6791-40ff-b94e-80a5d4a4ebb0@
qu.2.27.info=  Type=numeric;
  Course=202;
@
qu.2.27.weighting=1,1@
qu.2.27.numbering=alpha@
qu.2.27.part.1.name=sro_id_1@
qu.2.27.part.1.answer.units=@
qu.2.27.part.1.numStyle=   @
qu.2.27.part.1.editing=useHTML@
qu.2.27.part.1.showUnits=false@
qu.2.27.part.1.err=0.0010@
qu.2.27.part.1.question=(Unset)@
qu.2.27.part.1.mode=Numeric@
qu.2.27.part.1.grading=toler_abs@
qu.2.27.part.1.negStyle=both@
qu.2.27.part.1.answer.num=$AnsMean@
qu.2.27.part.2.name=sro_id_2@
qu.2.27.part.2.answer.units=@
qu.2.27.part.2.numStyle=   @
qu.2.27.part.2.editing=useHTML@
qu.2.27.part.2.showUnits=false@
qu.2.27.part.2.err=0.0010@
qu.2.27.part.2.question=(Unset)@
qu.2.27.part.2.mode=Numeric@
qu.2.27.part.2.grading=toler_abs@
qu.2.27.part.2.negStyle=both@
qu.2.27.part.2.answer.num=$AnsSD@
qu.2.27.question=<div title="UW Statistics Bank/Numerical Analysis/Measures of Centre/Expected Value/Q$Q"><img hspace="4" align="$Align" src="__BASE_URI__NA/MoC/ExpectedValue/Scale$Which.gif" alt="Scale" title="Scale [IMG:Scale$Which.gif]" />You have two scales for measuring weights in a chemistry lab. Both scales give answers that vary a bit in repeated weighings of the same item. If the true weight of a compound is 2 grams (g), the first scale produces readings X that have mean $EX g and standard deviation $stdevX g. The second scale&rsquo;s readings Y have mean $EY g and standard deviation $stdevY g. (Assume that the readings X and Y are independent.)&nbsp; You measure once with each scale and average the readings. Your result is <math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000' veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><mi>Z</mi><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mrow><mfrac><mrow><mi>X</mi><mo lspace='0.2222222em' rspace='0.2222222em'>&plus;</mo><mi>Y</mi></mrow><mrow><mn>2</mn></mrow></mfrac></mrow></mrow></mstyle></math>.<br /><p><br />What is the mean of Z? (please round to 4 decimals)? <span>&nbsp;</span><1><span>&nbsp;</span></p><p>What is the standard deviation of Z? (please round to 4 decimals)? <span>&nbsp;</span><2><span>&nbsp;</span></p></div>@

qu.2.28.question=<div title="UW Statistics Bank/Numerical Analysis/Measures of Centre/Expected Value/Q$Q">You play a game where a number from the set {$Lower, $LP1,...,$UM1, $Upper} is drawn at random. If the number drawn is x, you win 2<sup>x</sup> dollars. (For example if you draw $Ex you will win \\$$WinEx.) Find your expected winnings. (2 decimals, or answer with a fraction.)</div>@
qu.2.28.answer.num=$WinD@
qu.2.28.answer.units=@
qu.2.28.showUnits=false@
qu.2.28.grading=toler_abs@
qu.2.28.err=0.1@
qu.2.28.negStyle=minus@
qu.2.28.numStyle=thousands scientific dollars arithmetic@
qu.2.28.mode=Numeric@
qu.2.28.name=12. Draw number game.@
qu.2.28.comment=<p>Let <em><font size="3" face="Times New Roman">X</font></em> be the r.v. whose value is the value of the number selected. Each number is equally likely to be drawn, so <math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000'  veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><mi>P</mi><mfenced open='(' close=')' separators=','><mrow><mi>X</mi><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mi>i</mi></mrow></mfenced><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mrow><mfrac><mn>1</mn><mrow><mi mathvariant='normal'>$Num</mi></mrow></mfrac></mrow></mrow></mstyle></math> for <font size="3" face="Times New Roman"><em>i</em> = $Lower, $LP1, ... ,$UM1, $Upper</font> . You must determine&nbsp; <font size="3" face="Times New Roman"><em>E</em>(2<em><sup>X</sup></em>)</font>:</p>
<p><math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000'  veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><mo lspace='0.0em' rspace='0.0em'>&#32;</mo></mrow><mrow><mo lspace='0.0em' rspace='0.0em'>&#32;</mo></mrow><mrow><mi>E</mi><mfenced open='(' close=')' separators=','><mrow><msup><mn>2</mn><mrow><mi>x</mi></mrow></msup></mrow></mfenced><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><munderover><mo lspace='0.0em' rspace='0.1666667em' stretchy='true' largeop='true' movablelimits='true'>&Sum;</mo><mrow><mi mathcolor='#800080'>i</mi><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mi mathvariant='normal'>$Lower</mi></mrow><mrow><mi mathvariant='normal'>$Upper</mi></mrow></munderover><mfrac><mn>1</mn><mrow><mi mathvariant='normal'>$Num</mi></mrow></mfrac><mo lspace='0.0em' rspace='0.0em'>&sdot;</mo><msup><mn>2</mn><mrow><mi>i</mi></mrow></msup></mrow><mrow><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo></mrow><mrow><mi mathvariant='normal'>$Win</mi></mrow><mrow><mo lspace='0.0em' rspace='0.0em'>&#32;</mo><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mo lspace='0.0em' rspace='0.0em'>&#32;</mo><mi mathvariant='normal'>$WinD</mi></mrow></mstyle></math></p>@
qu.2.28.editing=useHTML@
qu.2.28.solution=@
qu.2.28.algorithm=$Q=12;
$Lower=range(-5,5);
$LP1=$Lower+1;
$Upper=range($Lower+4,$Lower+8,1);
$UM1=$Upper-1;
$Ex=$Lower+2;
$WinEx=decimal(2,2^$Ex);
$Num=$Upper-$Lower+1;
$Win=maple("W:=0:for i from $Lower to $Upper do W:=W+2^i end do:W:=W/$Num:W");
$WinD=decimal(2,$Win);@
qu.2.28.uid=b72b135f-3157-4304-ac57-78be838ca490@
qu.2.28.info=  Course=230;
  Type=numeric;
@

qu.2.29.question=<div title="UW Statistics Bank/Numerical Analysis/Measures of Centre/Expected Value/Q$Q">Peter&rsquo;s instructor uses a computer to average student grades. Peter has a semester mean grade of $Average. The instructor has accidentally deleted one of Peter&rsquo;s grades from the computer storage. The remaining test scores for him are $G1, $G2, $G3, $G4, $G5, $G6, $G7 and $G8,. What&rsquo;s the value of the missing test score?</div>@
qu.2.29.answer.num=$G9@
qu.2.29.answer.units=@
qu.2.29.showUnits=false@
qu.2.29.grading=exact_value@
qu.2.29.negStyle=minus@
qu.2.29.numStyle=thousands scientific dollars arithmetic@
qu.2.29.mode=Numeric@
qu.2.29.name=23. Missing Grade@
qu.2.29.comment=<p><br />
Let the "missing" grade be x . Then the average is: <math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000'  veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><mi mathvariant='normal'>$Average</mi><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mrow><mfrac><mrow><mi>x</mi><mo lspace='0.2222222em' rspace='0.2222222em'>&plus;</mo><mi mathvariant='normal'>$G1</mi><mo lspace='0.2222222em' rspace='0.2222222em'>&plus;</mo><mi mathvariant='normal'>$G2</mi><mo lspace='0.2222222em' rspace='0.2222222em'>&plus;</mo><mo lspace='0.2222222em' rspace='0.0em'>..</mo><mo lspace='0.2222222em' rspace='0.0em'>..</mo><mo lspace='0.2222222em' rspace='0.2222222em'>&plus;</mo><mi mathvariant='normal'>$G8</mi></mrow><mrow><mn>9</mn></mrow></mfrac></mrow></mrow></mstyle></math><br />
Thus <math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000'  veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><mi>x</mi><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mn>9</mn><mo lspace='0.0em' rspace='0.0em'>&sdot;</mo><mi mathvariant='normal'>$Average</mi><mo lspace='0.2222222em' rspace='0.2222222em'>&minus;</mo><mfenced open='(' close=')' separators=','><mrow><mi mathvariant='normal'>$G1</mi><mo lspace='0.2222222em' rspace='0.2222222em'>&plus;</mo><mi mathvariant='normal'>$G2</mi><mo lspace='0.2222222em' rspace='0.2222222em'>&plus;</mo><mo lspace='0.2222222em' rspace='0.0em'>..</mo><mo lspace='0.0em' rspace='0.0em'>&period;</mo><mo lspace='0.2222222em' rspace='0.2222222em'>&plus;</mo><mi mathvariant='normal'>$G8</mi></mrow></mfenced><mo lspace='0.0em' rspace='0.0em'>&#32;</mo><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mo lspace='0.0em' rspace='0.0em'>&#32;</mo><mi mathvariant='normal'>$G9</mi></mrow></mstyle></math></p>@
qu.2.29.editing=useHTML@
qu.2.29.solution=@
qu.2.29.algorithm=$Q=23;
$G1=range(45,95,1);
$G2=72;
$G3=switch(rint(2),77,67);
$G4=range(45,95,1);
$G5=switch(rint(2),75,46);
$G6=range(65,95,1);
$G7=switch(rint(2),55,86);
$G8=range(60,90,1);
$Sum8=$G1+$G2+$G3+$G4+$G5+$G6+$G7+$G8;
$Ave8=$Sum8/8;
$Average=int($Ave8)+1;
$G9=9*$Average-$Sum8;@
qu.2.29.uid=71e3c3a5-9e3a-463d-9cd2-5b4ba9946e94@
qu.2.29.info=  Keyword=mean;
  Course=202;
  Course=230;
  Difficulty=3;
  Type=numeric;
@

qu.3.topic=Median and Mode@

qu.3.1.mode=Multiple Choice@
qu.3.1.name=08. Ordered data characteristics@
qu.3.1.comment=<p>When you have an even number of data points, the median is defined to be the average (mean) of the middle two points. Note that all the other statements cannot be determined generally, they may or may not be true, depending on the data set.</p>@
qu.3.1.editing=useHTML@
qu.3.1.solution=@
qu.3.1.algorithm=$Q=08;
$SS=range(4,12,2);
$LMP=$SS/2;
$UMP=$LMP+1;
$W=maple('["!","!","second","third","fourth","fifth","sixth","seventh"]');
$LMPW=switch($LMP,$W);
$UMPW=switch($UMP,$W);
$Lowest=range(3,9,1);
$Range=range(8,16,1);@
qu.3.1.uid=437afe54-81f0-4e35-89a4-0f2317e2ea89@
qu.3.1.info=  Difficulty=3;
  Keyword=mode;
  Keyword=median;
  Course=202;
  Course=230;
  Type=MC;
@
qu.3.1.question=<div title="UW Statistics Bank/Numerical Analysis/Measures of Centre/Median and Mode/Q$Q">
A sample of $SS data points is arranged in ascending order. The lowest value is $Lowest and the range of the data is $Range. Which one of the following statements must be true?</div>@
qu.3.1.answer=1@
qu.3.1.choice.1=The median equals the mean of the $LMPW and $UMPW numbers.@
qu.3.1.choice.2=The median equals the $LMPW number@
qu.3.1.choice.3=The mode is the value of the fourth number.@
qu.3.1.choice.4=The mean is greater than $Range@
qu.3.1.choice.5=The mode is $Lowest@
qu.3.1.fixed=@

qu.3.2.mode=True False@
qu.3.2.name=05+. Mode vs. Mean@
qu.3.2.comment=<p>As a counterexample take the case where <em>X</em> takes on only one value!</p>@
qu.3.2.editing=useHTML@
qu.3.2.solution=@
qu.3.2.algorithm=@
qu.3.2.uid=726e7e76-79b5-4575-bd82-41b9c9983231@
qu.3.2.info=  Difficulty=1;
  Keyword=mode;
  Keyword=mean;
  Course=230;
  Course=202;
  Type=TF;
@
qu.3.2.question=<div title="UW Statistics Bank/Numerical Analysis/Measures of Centre/Median and Mode/Q05+">Let <em><font size="3" face="Times New Roman">X</font></em> be a random variable. True or False: The <em>mode</em> of <em><font size="3" face="Times New Roman">X</font></em> can never equal <font size="3" face="Times New Roman"><em>E</em>(<em>X</em>)</font>.</div>@
qu.3.2.answer=2@
qu.3.2.choice.1=True@
qu.3.2.choice.2=False@
qu.3.2.fixed=@

qu.3.3.mode=Multiple Choice@
qu.3.3.name=07. No mode means?@
qu.3.3.comment=<p>If any value occurred more often than the others, it would be the mode! Another way to state this question is to say that every data point is a mode.</p>@
qu.3.3.editing=useHTML@
qu.3.3.solution=@
qu.3.3.algorithm=$Q=7;
$Alt3=switch(rint(3),"The mean must be 0","The mean must be positive","The mean must be negative");
$Alt4=switch(rint(3),"The variance is 1","The variance is -1.","The variance cannot be calculated.");@
qu.3.3.uid=e2fe36b9-76bc-47b4-b078-80909ca2d83b@
qu.3.3.info=  Keyword=mode;
  Difficulty=4;
  Course=202;
  Course=230;
  Type=MC;
@
qu.3.3.question=<div title="UW Statistics Bank/Numerical Analysis/Measures of Centre/Median and Mode/Q$Q">
If a distribution of data has no mode, which of the following conditions must exist?</div>@
qu.3.3.answer=3@
qu.3.3.choice.1=Each data value must be positive@
qu.3.3.choice.2=The number of positive data equals the number of negative data@
qu.3.3.choice.3=Each data value has the same frequency@
qu.3.3.choice.4=$Alt3@
qu.3.3.choice.5=$Alt4@
qu.3.3.fixed=@

qu.3.4.question=<div title="UW Statistics Bank/Numerical Analysis/Measures of Centre/Median and Mode/Q$Q"><img hspace="4" align="$Align" src="__BASE_URI__NA/MoC/MedianAndMode/2Dice$Which.gif" alt="Two dice" title="Two dice [IMG:2Dice$Which.gif]" />Consider rolling two dice. Let X be a random variable defined as (larger value) - (smaller value). X takes on values from the set {0,1,2,3,4,5}. What is the <em>mode</em> of this distribution?</div>@
qu.3.4.answer.num=1@
qu.3.4.answer.units=@
qu.3.4.showUnits=false@
qu.3.4.grading=exact_value@
qu.3.4.negStyle=minus@
qu.3.4.numStyle=thousands scientific dollars arithmetic@
qu.3.4.mode=Numeric@
qu.3.4.name=03. Mode of dice difference@
qu.3.4.comment=<p>The easiest way is to list all the rolls and see what value occurs most often:</p>
<table cellpadding="3" border="1">
    <tbody>
        <tr>
            <td align="center">X</td>
            <td align="center">How?</td>
            <td align="center">#</td>
        </tr>
        <tr>
            <td align="right">0</td>
            <td>(1,1)&hellip;(6,6)</td>
            <td align="right">6</td>
        </tr>
        <tr>
            <td align="right">1</td>
            <td style="vertical-align: top;">(1,2),(2,3),..(5,6),<br />
            (6,5),..(2,1)</td>
            <td align="right" style="vertical-align: top;">10</td>
        </tr>
        <tr>
            <td align="right" style="vertical-align: top;">2</td>
            <td style="vertical-align: top;">(1,3),(2,4),(3,5),(4,6),<br />
            (6,4),(5,3),(4,2),(3,1)</td>
            <td align="right" style="vertical-align: top;">8</td>
        </tr>
        <tr>
            <td align="right">3</td>
            <td style="vertical-align: top;">(1,4),(2,5),(3,6),<br />
            (6,3),(5,2),(4,1)</td>
            <td align="right" style="vertical-align: top;">6</td>
        </tr>
        <tr>
            <td align="right" style="vertical-align: top;">4</td>
            <td style="vertical-align: top;">(1,5),(2,6),(6,2),(5,1)</td>
            <td align="right" style="vertical-align: top;">4</td>
        </tr>
        <tr>
            <td align="right" style="vertical-align: top;">5</td>
            <td style="vertical-align: top;">(1,6),(6,1)</td>
            <td align="right" style="vertical-align: top;">2</td>
        </tr>
    </tbody>
</table>
<p><br />
As you can easily see from the table, the mode must be 1 since it occurs 10 times, which is more than any other value of X.</p>@
qu.3.4.editing=useHTML@
qu.3.4.solution=@
qu.3.4.algorithm=$Q=3;
$Which=rint(5);
$Align=switch(rint(2),"Left","Right");@
qu.3.4.uid=1625368f-2bb7-4a70-b6c0-73b6942a0985@
qu.3.4.info=  Difficulty=1;
  Keyword=mode;
  Course=202;
  Course=230;
  Type=numeric;
  Algorithmic=no;
@

qu.3.5.mode=Multiple Choice@
qu.3.5.name=01b. Median (MC)@
qu.3.5.comment=<p>First, sort the numbers:</p>
<p>$T</p>
<p>There are an $ListParity number ($Num) of numbers, so the median is $Explain ($Median).</p>@
qu.3.5.editing=useHTML@
qu.3.5.solution=@
qu.3.5.algorithm=$Q="01b";
$Num=rint(6,12,1);
$ListParity=if(eq($Num/2,int($Num/2)),"even","odd");
$Explain=if(eq($Num/2,int($Num/2)),"halfway between the middle two numbers","the middle number");
$S=maple("randomize():
convert(LinearAlgebra[RandomVector]($Num,generator	=rand(1..2*$Num)),list)");
$T=maple("sort($S)");
$PMedian	=	maple("Statistics[Median]($S)");
$Median	=	decimal(1,$PMedian);
$Alt1=int(range(0.4,0.8,0.05)*$Median)+switch(rint(2),0,0.5);
$Alt2=int(range(1.2,1.4,0.05)*$Median)+switch(rint(2),0,0.5);
$Alt3=$Alt2+range(1,4,0.5);@
qu.3.5.uid=95859178-3964-450d-a709-c033faf1f66b@
qu.3.5.info=  Keyword=median;
  Difficulty=1;
  Course=202;
  Course=230;
  Type=MC;
@
qu.3.5.question=<div title="UW Statistics Bank/Numerical Analysis/Measures of Centre/Median and Mode/Q$Q">
Find the median for the following data.
<p>$S</p>
</div>@
qu.3.5.answer=3@
qu.3.5.choice.1=$Alt1@
qu.3.5.choice.2=$Alt2@
qu.3.5.choice.3=$Median@
qu.3.5.choice.4=$Alt3@
qu.3.5.fixed=@

qu.3.6.mode=Multiple Choice@
qu.3.6.name=04. Mode & Movie Attendance@
qu.3.6.comment=<p>$Ans has a mode of 1. $Row1, $Row3 and $Row4 have modes of 2, 2, and 3 respectively.</p>@
qu.3.6.editing=useHTML@
qu.3.6.solution=@
qu.3.6.algorithm=$Q=4;
$AnsN=rint(3);
$Ans=switch($AnsN,["John","Mary","Brian","Kelly"]);
$Row1N=if(eq($AnsN,3),0,$AnsN+1);
$Row3N=if(eq($Row1N,3),0,$Row1N+1);
$Row4N=if(eq($Row3N,3),0,$Row3N+1);
$Row1=switch($Row1N,["John","Mary","Brian","Kelly"]);
$Row3=switch($Row3N,["John","Mary","Brian","Kelly"]);
$Row4=switch($Row4N,["John","Mary","Brian","Kelly"]);@
qu.3.6.uid=3b52a208-e46c-4ee2-b9e1-70849e50af53@
qu.3.6.info=  Difficulty=1;
  Course=202;
  Course=230;
  Keyword=mode;
  Type=MC;
@
qu.3.6.question=<div title="UW Statistics Bank/Numerical Analysis/Measures of Centre/Median and Mode/Q$Q">You and your friends are comparing the number of times you have been to the movies in the past year. The following table illustrates how many times each person went to the movie theatre in each month.
<p>&nbsp;</p>
<center>
<table border="1">
    <tbody>
        <tr>
            <td>&nbsp;</td>
            <td><strong>Jan.</strong></td>
            <td><strong>Feb.</strong></td>
            <td><strong>Mar.</strong></td>
            <td><strong>Apr</strong>.</td>
            <td><strong>May</strong></td>
            <td><strong>June</strong></td>
            <td><strong>July</strong></td>
            <td><strong>Aug.</strong></td>
            <td><strong>Sept.</strong></td>
            <td><strong>Oct.</strong></td>
            <td><strong>Nov.</strong></td>
            <td><strong>Dec.</strong></td>
        </tr>
        <tr>
            <td><strong>$Row1</strong></td>
            <td>1</td>
            <td>3</td>
            <td>2</td>
            <td>5</td>
            <td>2</td>
            <td>3</td>
            <td>1</td>
            <td>4</td>
            <td>2</td>
            <td>3</td>
            <td>2</td>
            <td>1</td>
        </tr>
        <tr>
            <td><strong>$Ans</strong></td>
            <td>1</td>
            <td>2</td>
            <td>1</td>
            <td>1</td>
            <td>1</td>
            <td>3</td>
            <td>3</td>
            <td>2</td>
            <td>2</td>
            <td>4</td>
            <td>1</td>
            <td>2</td>
        </tr>
        <tr>
            <td><strong>$Row3</strong></td>
            <td>1</td>
            <td>3</td>
            <td>2</td>
            <td>2</td>
            <td>1</td>
            <td>4</td>
            <td>5</td>
            <td>3</td>
            <td>2</td>
            <td>2</td>
            <td>1</td>
            <td>3</td>
        </tr>
        <tr>
            <td><strong>$Row4</strong></td>
            <td>3</td>
            <td>2</td>
            <td>1</td>
            <td>1</td>
            <td>3</td>
            <td>2</td>
            <td>4</td>
            <td>1</td>
            <td>3</td>
            <td>2</td>
            <td>3</td>
            <td>3</td>
        </tr>
    </tbody>
</table>
</center>
<p>By comparing <span style="font-weight: bold;">modes</span>, which person went to the movies the least per month?</p>
</div>@
qu.3.6.answer=2@
qu.3.6.choice.1=$Row1@
qu.3.6.choice.2=$Ans@
qu.3.6.choice.3=$Row3@
qu.3.6.choice.4=$Row4@
qu.3.6.choice.5=Two or more of the above.@
qu.3.6.fixed=4@

qu.3.7.mode=Inline@
qu.3.7.name=01a. Median@
qu.3.7.comment=<p>First, sort the numbers:</p>
<p>$T</p>
<p>There are an $ListParity number ($Num) of numbers, so the median is $Explain ($Median).</p>@
qu.3.7.editing=useHTML@
qu.3.7.solution=@
qu.3.7.algorithm=$Q="01a";
$Num=rint(6,16,1);
$ListParity=if(eq($Num/2,int($Num/2)),"even","odd");
$Explain=if(eq($Num/2,int($Num/2)),"halfway between the middle two numbers","the middle number");
$S=maple("randomize():
convert(LinearAlgebra[RandomVector]($Num,generator	=rand(1..2*$Num)),list)");
$T=maple("sort($S)");
$PMedian	=	maple("Statistics[Median]($S)");
$Median	=	decimal(1,$PMedian);@
qu.3.7.uid=1a85a987-4edd-41db-945b-8447a1a56584@
qu.3.7.info=  Difficulty=1;
  Keyword=median;
  Course=202;
  Course=230;
  Type=numeric;
@
qu.3.7.weighting=1@
qu.3.7.numbering=alpha@
qu.3.7.part.1.name=sro_id_1@
qu.3.7.part.1.answer.units=@
qu.3.7.part.1.numStyle=thousands scientific  arithmetic@
qu.3.7.part.1.editing=useHTML@
qu.3.7.part.1.showUnits=false@
qu.3.7.part.1.err=0.01@
qu.3.7.part.1.question=(Unset)@
qu.3.7.part.1.mode=Numeric@
qu.3.7.part.1.grading=toler_abs@
qu.3.7.part.1.negStyle=minus@
qu.3.7.part.1.answer.num=$Median@
qu.3.7.question=<div title="UW Statistics Bank/Numerical Analysis/Measures of Centre/Median and Mode/Q$Q">What is the median of the following list of numbers? <br /><p>$S</p><p><span> </span><1></p></div>@

qu.3.8.mode=Multiple Choice@
qu.3.8.name=06. Maximum points given mode@
qu.3.8.comment=<p>There must also be $W4 $X4's, since it is also the mode and so must occur as often as $X3 does. Then the maximum number of $X5's allowed is $W5, otherwise it would be a mode also. So the maximum number of data points is $C1+$C2+$C3+$C4+$C5 = $Ans.</p>@
qu.3.8.editing=useHTML@
qu.3.8.solution=@
qu.3.8.algorithm=$Q=6;
$W=maple('["0","one","two","three","four","five","six","seven","eight","nine","ten","eleven","twelve"]');
$X1=range(1,4,1);
$X2=range($X1+1,7,1);
$X3=8;
$X4=range(9,11,1);
$X5=12;
$C1=range(3,7,1);
$C2=range(2,6,1);
$C3=range(8,12,1);
$C4=$C3;
$C5=$C4-1;
$Ans=$C1+$C2+$C3+$C4+$C5;
$W1=switch($C1,$W);
$W2=switch($C2,$W);
$W3=switch($C3,$W);
$W4=switch($C4,$W);
$W5=switch($C5,$W);
$Alt1=range($Ans+1,$Ans+7,1);
$Alt2=$C2+$C3+$C5+1;
$Alt3=$Alt1+range(2,7,1);@
qu.3.8.uid=cfa43b53-4f80-4202-ba72-56737cbed95f@
qu.3.8.info=  Keyword=mode;
  Difficulty=4;
  Course=202;
  Course=230;
  Type=MC;
@
qu.3.8.question=<div title="UW Statistics Bank/Numerical Analysis/Measures of Centre/Median and Mode/Q$Q">A population of data consists only of the numbers $X1, $X2, $X3, $X4,and $X5. There are $W1 $X1's, $W2 $X2's, and $W3 $X3's. If this population's modes are $X3 and $X4, what is the maximum allowable number of data?</div>@
qu.3.8.answer=1@
qu.3.8.choice.1=$Ans@
qu.3.8.choice.2=$Alt1@
qu.3.8.choice.3=$Alt2@
qu.3.8.choice.4=$Alt3@
qu.3.8.fixed=@

qu.3.9.mode=True False@
qu.3.9.name=02. Mode is unique@
qu.3.9.comment=No, indeed it is not. It is quite possible that two or more values
"tie" for most frequent occurrences. Consider a set of drawings from
the numbers 0,1,...,9 that results in these outcomes:<br>
<br>
0,0,1,1,1,2,3,4,4,4,5,5,6,8,9,9,9<br>
<br>
then 1, 4, and 9 are all the mode!<br>@
qu.3.9.editing=useHTML@
qu.3.9.solution=@
qu.3.9.algorithm=@
qu.3.9.uid=3be1244b-54e2-4ce7-8aa0-d323201a827a@
qu.3.9.info=  Difficulty=1;
  Keyword=mode;
  Course=202;
  Course=230;
  Algorithmic=no;
@
qu.3.9.question=<div title="UW Statistics Bank/Numerical Analysis/Measures of Centre/Median and Mode/Q02">
The mode of a set of values is unique.</div>@
qu.3.9.answer=2@
qu.3.9.choice.1=True@
qu.3.9.choice.2=False@
qu.3.9.fixed=@

qu.4.topic=Other Measures@

qu.4.1.question=<div title="UW Statistics Bank/Numerical Analysis/Measures of Centre/Other Measures/Q$Q">Find the geometric mean of the 5 numbers (3 decimals): $G1, $G2, $G3, $G4, $G5.</div>@
qu.4.1.answer.num=$GMean@
qu.4.1.answer.units=@
qu.4.1.showUnits=false@
qu.4.1.grading=toler_abs@
qu.4.1.err=0.01@
qu.4.1.negStyle=minus@
qu.4.1.numStyle=thousands scientific dollars arithmetic@
qu.4.1.mode=Numeric@
qu.4.1.name=01. Geometric Mean of 5 Numbers@
qu.4.1.comment=<p>The geometric mean of the 5 numbers is&nbsp; <math xmlns='http://www.w3.org/1998/Math/MathML'><mstyle fontfamily='Times New Roman' mathsize='12' mathcolor='#000000' veryverythinmathspace='0.0555556em' verythinmathspace='0.111111em' thinmathspace='0.166667em' mediummathspace='0.222222em' thickmathspace='0.277778em' verythickmathspace='0.333333em' veryverythickmathspace='0.388889em' scriptlevel='0' scriptsizemultiplier='0.71' scriptminsize='8.0pt'><mrow><msup><mfenced open='(' close=')' separators=','><mrow><mi mathvariant='normal'>$G1</mi><mo lspace='0.0em' rspace='0.0em'>&sdot;</mo><mi mathvariant='normal'>$G2</mi><mo lspace='0.0em' rspace='0.0em'>&sdot;</mo><mi mathvariant='normal'>$G3</mi><mo lspace='0.0em' rspace='0.0em'>&sdot;</mo><mi mathvariant='normal'>$G4</mi><mo lspace='0.0em' rspace='0.0em'>&sdot;</mo><mi mathvariant='normal'>$G5</mi></mrow></mfenced><mrow><mfrac><mn>1</mn><mrow><mn>5</mn></mrow></mfrac></mrow></msup><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mi mathvariant='normal'>$GMean</mi></mrow></mstyle></math></p>@
qu.4.1.editing=useHTML@
qu.4.1.solution=@
qu.4.1.algorithm=$Q=1;
$G1=range(1,20,1);
$G2=range(1,20,1);
$G3=range(1,20,1);
$G4=range(1,20,1);
$G5=range(1,20,1);
$Product=$G1*$G2*$G3*$G4*$G5;
$GMean=decimal(2,$Product^0.2);@
qu.4.1.uid=7bd141f5-2a70-4083-b3ae-d42621266d78@
qu.4.1.info=  Keyword=geometric mean;
  Course=202;
  Type=numeric;
@

