qu.1.topic=Basics@

qu.1.1.question=<div title="UW Statistics Bank/Numerical Analysis/Counting Techniques/Q$Q"><img align="$Align" alt="Dice" title="Dice [IMG:Dice$Which.gif]" src="__BASE_URI__NA/CT/Dice$Which.gif" />$n (fair, 6-sided) dice are rolled simultaneously. What is the number of possible outcomes in which at least one of the die shows $p?</div>@
qu.1.1.answer.num=$Ans@
qu.1.1.answer.units=@
qu.1.1.showUnits=false@
qu.1.1.grading=exact_value@
qu.1.1.negStyle=minus@
qu.1.1.numStyle=thousands scientific dollars arithmetic@
qu.1.1.mode=Numeric@
qu.1.1.name=05. Dice - show a face@
qu.1.1.comment=<p>When $n dice are rolled simultaneously, there are 6<sup>$n</sup> = $tot outcomes. The converse of what is asked in the question is that none of the dice show '6'. That is all $n dice show any of the other 5 numbers. That is possible in 5<sup>$n</sup> = $other outcomes. <br />
<br />
Therefore, in $tot - $other = $Ans outcomes at least one of the dice will show 6.</p>@
qu.1.1.editing=useHTML@
qu.1.1.solution=@
qu.1.1.algorithm=$Q=5;
$Align=switch(rint(2),"Left","Right");
$Which=1+rint(4);
$n=range(4,7,1);
$p=range(1,6,1);
$tot=6^$n;
$other=5^$n;
$Ans=$tot-$other;@
qu.1.1.uid=36daa696-8e95-4195-9b7e-84bdb9774cc5@
qu.1.1.info=  Difficulty=3;
  Course=202;
  Course=230;
@

qu.1.2.question=<div title="UW Statistics Bank/Numerical Analysis/Counting Techniques/Basics/Q$Q"><img hspace="4" align="$Align" src="__BASE_URI__NA/CT/Basics/Gift$Which.gif" alt="Gift" title="Gift [IMG:Gift$Which.gif]" />There is a town party in Pleasantville where $n families of $p people get together. If one representative from each family gives a gift to everyone at the party except people from their own family, how many gifts are given?</div>@
qu.1.2.answer.num=$Ans@
qu.1.2.answer.units=@
qu.1.2.showUnits=false@
qu.1.2.grading=exact_value@
qu.1.2.negStyle=minus@
qu.1.2.numStyle=thousands scientific dollars arithmetic@
qu.1.2.mode=Numeric@
qu.1.2.name=06. Presents at Party - $n families of size $p - number of gifts@
qu.1.2.comment=<p>Each of the $n family representatives gives $p presents to $n-1 other families: ($n)($p)($n-1) = $Ans.</p>@
qu.1.2.editing=useHTML@
qu.1.2.solution=@
qu.1.2.algorithm=$Q=6;
$Which=rint(4);
$Align=switch(rint(2),"Left","Right");
$n=range(3,7,1);
$p=range(2,5,1);
$Ans=$n*($n-1)*$p;@
qu.1.2.uid=2172d384-4ae7-496e-a7ef-77a321e64c8e@
qu.1.2.info=  Difficulty=0;
  Type=numeric;
@

qu.1.3.mode=Multiple Choice@
qu.1.3.name=03. C(n,r) = value?@
qu.1.3.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><mfenced open='(' close=')' separators=','><mtable rowalign='baseline' columnalign='center' groupalign='{left}' rowspacing='1.0ex'><mtr><mtd><mrow><mi>$n</mi></mrow></mtd></mtr><mtr><mtd><mrow><mi>$r</mi></mrow></mtd></mtr></mtable></mfenced></mrow><mrow><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mfrac><mrow><mi>$n</mi><mo lspace='0.1111111em' rspace='0.1111111em'>&excl;</mo></mrow><mrow><mi>$r</mi><mo lspace='0.1111111em' rspace='0.1111111em'>&excl;</mo><mfenced open='(' close=')' separators=','><mrow><mi>$n</mi><mo lspace='0.2222222em' rspace='0.2222222em'>&minus;</mo><mi>$r</mi></mrow></mfenced><mo lspace='0.1111111em' rspace='0.1111111em'>&excl;</mo></mrow></mfrac><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mi>$TrueValue</mi></mrow></mstyle></math> $FB $AnsShow, so the answer is $Ans.</p>@
qu.1.3.editing=useHTML@
qu.1.3.solution=@
qu.1.3.algorithm=$Q=3;
$n=range(5,8,1);
$r=range(2,$n-1,1);
$Pick=rint(2);
$AnsShow=switch($Pick,fact($n)/(fact($r)*fact($n-$r)),fact($n)*fact($r)/$fact($n-$r));
$Ans=switch($Pick,"True","False");
$Alt=switch($Pick,"False","True");
$TrueValue=fact($n)/(fact($r)*fact($n-$r));
$FB=switch($Pick,"=","≠");@
qu.1.3.uid=114ae57f-3604-41e8-b627-b3cb0e9ebadf@
qu.1.3.info=  Course=202;
  Type=MC;
@
qu.1.3.question=<div title="UW Statistics Bank/Numerical Analysis/Counting Techniques/Basics/Q$Q">
<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=','><mtable rowalign='baseline' columnalign='center' groupalign='{left}' rowspacing='1.0ex'><mtr><mtd><mrow><mi mathvariant='normal'>$n</mi></mrow></mtd></mtr><mtr><mtd><mrow><mi mathvariant='normal'>$r</mi></mrow></mtd></mtr></mtable></mfenced></mrow></mstyle></math> (also written as <sub>$n</sub>C<sub>$r</sub> or C($n,$r)) is equal to $AnsShow</div>@
qu.1.3.answer=1@
qu.1.3.choice.1=$Ans@
qu.1.3.choice.2=$Alt@
qu.1.3.fixed=@

qu.1.4.mode=Multiple Choice@
qu.1.4.name=06+. # coin tosses@
qu.1.4.comment=<p>These are independent events. There are two possible outcomes for the first coin, then for each of these two possible outcomes for the second, etc. Thus the number of possible outcomes is 2<sup>$n</sup> .</p>@
qu.1.4.editing=useHTML@
qu.1.4.solution=@
qu.1.4.algorithm=$Q=6;
$Align=switch(rint(2),"Left","Right");
$Which=rint(4);
$n=range(2,5,1);
$NumName=switch($n-2,"two","three","four","five");
$Ans=2^$n;
$Alt1=2^($n-1);
$Alt2=2^($n+1);
$Alt3=2^$n+10;@
qu.1.4.uid=ad28ddd5-c2fb-4c5a-8017-ed7bd8e887b9@
qu.1.4.info=  Course=202;
  Type=MC;
@
qu.1.4.question=<div title="UW Statistics Bank/Probability/Sample Spaces/Q$Q"><img hspace="4" align="$Align" src="__BASE_URI__Probability/SS/CanCoin$Which.gif" alt="Coin" title="Coin [IMG:CanCoin$Which.gif]" />How many possible outcomes would there be if $NumName coins were tossed once?</div>@
qu.1.4.answer=1@
qu.1.4.choice.1=$Ans@
qu.1.4.choice.2=$Alt1@
qu.1.4.choice.3=$Alt2@
qu.1.4.choice.4=$Alt3@
qu.1.4.fixed=@

qu.1.5.mode=Multiple Choice@
qu.1.5.name=04. Evaluate C(n,r)@
qu.1.5.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><mfenced open='(' close=')' separators=','><mtable rowalign='baseline' columnalign='center' groupalign='{left}' rowspacing='1.0ex'><mtr><mtd><mrow><mi>$Upper</mi></mrow></mtd></mtr><mtr><mtd><mrow><mi mathvariant='normal'>$Lower</mi></mrow></mtd></mtr></mtable></mfenced></mrow><mrow><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mfrac><mrow><mi mathvariant='normal'>$Upper</mi><mo lspace='0.1111111em' rspace='0.0em'>&excl;</mo></mrow><mrow><mi mathvariant='normal'>$Lower</mi><mo lspace='0.1111111em' rspace='0.1111111em'>&excl;</mo><mo lspace='0.0em' rspace='0.0em'>&sdot;</mo><mfenced open='(' close=')' separators=','><mrow><mi mathvariant='normal'>$Upper</mi><mo lspace='0.2222222em' rspace='0.2222222em'>&minus;</mo><mi mathvariant='normal'>$Lower</mi></mrow></mfenced><mo lspace='0.1111111em' rspace='0.0em'>&excl;</mo></mrow></mfrac><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mi mathvariant='normal'>$Ans</mi></mrow></mstyle></math></p>@
qu.1.5.editing=useHTML@
qu.1.5.solution=@
qu.1.5.algorithm=$Q=4;
$Upper=range(5,8,1);
$Lower=range(2,$Upper-1,1);
$Ans=fact($Upper)/(fact($Lower)*fact($Upper-$Lower));
$Alt1=fact($Upper-1)/(fact($Lower)*fact($Upper-$Lower-1));
$Alt2=fact($Upper+1)/(fact($Lower)*fact($Upper-$Lower+1));
$Alt3=$Alt2+rint(8)+1;@
qu.1.5.uid=6f3287aa-3358-4d8e-81d5-c752d8090390@
qu.1.5.info=  Difficulty=1;
  Type=MC;
@
qu.1.5.question=<div title="UW Statistics Bank/Numerical Analysis/Counting Techniques/Basics/Q$Q">
Evaluate: <sub>$Upper</sub>C<sub>$Lower&nbsp;</sub> (which can also be written as C($Upper,$Lower) or <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=','><mtable rowalign='baseline' columnalign='center' groupalign='{left}' rowspacing='1.0ex'><mtr><mtd><mrow><mi mathvariant='normal'>$Upper</mi></mrow></mtd></mtr><mtr><mtd><mrow><mi mathvariant='normal'>$Lower</mi></mrow></mtd></mtr></mtable></mfenced></mrow></mstyle></math>)</div>@
qu.1.5.answer=3@
qu.1.5.choice.1=$Alt1@
qu.1.5.choice.2=$Alt2@
qu.1.5.choice.3=$Ans@
qu.1.5.choice.4=$Alt3@
qu.1.5.fixed=@

qu.1.6.mode=Multiple Choice@
qu.1.6.name=07. How many coin tosses?@
qu.1.6.comment=<p>Just count how many levels there are in the tree, do NOT count the "leaves"!&nbsp; That is you are not asked for how many outcomes, just how many times the coin was tossed.</p>@
qu.1.6.editing=useHTML@
qu.1.6.solution=@
qu.1.6.algorithm=$Q=07;
$TossNum=1+rint(2);
$Ans=1+$TossNum;
$Alt1=5-$Ans;
$Alt2=2^($TossNum+1);
$Alt3=8*$TossNum-2;
$Alt4=5;@
qu.1.6.uid=c185d898-b21d-4754-8789-3a08f810327f@
qu.1.6.info=  Course=202;
  Type=MC;
@
qu.1.6.question=<div title="UW Statistics Bank/Numerical Analysis/Counting Techniques/Basics/Q$Q">How many times was the coin tossed in the figure below?
<p>&nbsp;</p>
<p><img alt="Binary Tree" src="__BASE_URI__NA/CT/Basics/CoinTossTree$TossNum.gif" title="Binary Tree [CoinTossTree$TossNum.gif]" /></p>
</div>@
qu.1.6.answer=1@
qu.1.6.choice.1=$Ans@
qu.1.6.choice.2=$Alt1@
qu.1.6.choice.3=$Alt2@
qu.1.6.choice.4=$Alt3@
qu.1.6.choice.5=$Alt4@
qu.1.6.fixed=@

qu.1.7.question=<div title="UW Statistics Bank/Numerical Analysis/Counting Techniques/Basics/Q$Q"><img width="87" hspace="4" height="89" align="right" src="__BASE_URI__Probability/Counting/NumberFloat.gif" alt="Floating numbers" title="Floating numbers [IMG:NumberFloat.gif]" />Box A contains the numbers $S1, $S1A, $S1B, and $S1C. Box B contains the numbers $S2, $S2A, $S2B, and $S2C. A number is first drawn from Box A and then another number from Box B. How many outcomes are possible if both numbers are $AskParity?</div>@
qu.1.7.answer.num=4@
qu.1.7.answer.units=@
qu.1.7.showUnits=false@
qu.1.7.grading=exact_value@
qu.1.7.negStyle=minus@
qu.1.7.numStyle=thousands scientific dollars arithmetic@
qu.1.7.mode=Numeric@
qu.1.7.name=01. How many outcomes?@
qu.1.7.comment=<p>There are 2 ways to draw an $AskParity number from A, and 2 ways to do it from B, so there are 4 possible outcomes.</p>@
qu.1.7.editing=useHTML@
qu.1.7.solution=@
qu.1.7.algorithm=$Q=1;
$S1=range(1,4,1);
$S1A=$S1+1;
$S1B=$S1+2;
$S1C=$S1+3;
$S2=range(8,11,1);
$S2A=$S2+1;
$S2B=$S2+2;
$S2C=$S2+3;
$AskParity=switch(rint(2),"odd","even");@
qu.1.7.uid=f52b1937-66c0-44b5-a008-1ac5e8eac0da@
qu.1.7.info=  Course=202;
  Type=numeric;
@

qu.1.8.mode=Multiple Choice@
qu.1.8.name=02. Possible Outcomes@
qu.1.8.comment=<p>Suppose the first result was "A". Then there are $ASteps possible outcomes.</p>
<p>Suppose the first result was "B". Then there are $BSteps possible outcomes.</p>
<p>In total there are $ASteps + $BSteps = $Ans possible outcomes.</p>@
qu.1.8.editing=useHTML@
qu.1.8.solution=@
qu.1.8.algorithm=$Q=2;
$ASteps=range(2,5,1);
$BSteps=range(10,18,2);
$Ans=$ASteps+$BSteps;
$Alt1=$ASteps*$BSteps;
$Alt2=$Ans-2-rint(4);
$Alt3=$Ans+3+rint(4);@
qu.1.8.uid=41bcbf71-3018-4ef5-8786-8cff573318d9@
qu.1.8.info=  Difficulty=2;
  Type=MC;
@
qu.1.8.question=<div title="UW Statistics Bank/Numerical Analysis/Counting Techniques/Basics/Q$Q">
A probability experiment has two steps. There are two possible results for the first step, call them "A" and "B". If the result for the first step was "A", then there would be $ASteps possible results for the second step. If the result for the first step was "B", then there would be $BSteps possible results for the second step. How many possible outcomes are there for this experiment?</div>@
qu.1.8.answer=1@
qu.1.8.choice.1=$Ans@
qu.1.8.choice.2=$Alt1@
qu.1.8.choice.3=$Alt2@
qu.1.8.choice.4=$Alt3@
qu.1.8.fixed=@

qu.1.9.mode=Multiple Choice@
qu.1.9.name=24. Possible Outcomes@
qu.1.9.comment=<p>Just consider how many outcomes there are for each of the first steps, then add the numbers. There are $ASteps possible outcomes if the first result is "A", there are $BSteps possible outcomes if the first step is "B". Thus there are $ASteps + $BSteps = $Ans outcomes possible.</p>@
qu.1.9.editing=useHTML@
qu.1.9.solution=@
qu.1.9.algorithm=$Q=24;
$ASteps=range(2,5,1);
$BSteps=range(10,18,2);
$Ans=$ASteps+$BSteps;
$Alt1=$ASteps*$BSteps;
$Alt2=$Ans-2-rint(4);
$Alt3=$Ans+3+rint(4);@
qu.1.9.uid=9f3b7464-0cb0-4992-9ee3-ed2f82e0a03c@
qu.1.9.info=  Course=202;
@
qu.1.9.question=<div title="UW Statistics Bank/Numerical Analysis/Counting Techniques/Q$Q">A probability experiment has two steps. There are two possible results for the first step, call them "A" and "B". If the result for the first step was "A", then there would be $ASteps possible results for the second step. If the result for the first step was "B", then there would be $BSteps possible results for the second step. How many possible outcomes are there for this experiment?
<p>&nbsp;</p>
</div>@
qu.1.9.answer=1@
qu.1.9.choice.1=$Ans@
qu.1.9.choice.2=$Alt1@
qu.1.9.choice.3=$Alt2@
qu.1.9.choice.4=$Alt3@
qu.1.9.fixed=@

qu.1.10.question=<div title="UW Statistics Bank/Numerical Analysis/Counting Techniques/Q$Q"><img width="50" hspace="4" height="50" align="right" src="__BASE_URI__NA/CT/Numbers1.gif" alt="Numbers" />Box A contains the numbers $S1, $S1A, $S1B, and $S1C. Box B contains the numbers $S2, $S2A, $S2B, and $S2C. A number is first drawn from Box A and then another number from Box B. How many outcomes are possible if both numbers are $AskParity?</div>@
qu.1.10.answer.num=4@
qu.1.10.answer.units=@
qu.1.10.showUnits=false@
qu.1.10.grading=exact_value@
qu.1.10.negStyle=minus@
qu.1.10.numStyle=thousands scientific dollars arithmetic@
qu.1.10.mode=Numeric@
qu.1.10.name=25. How many outcomes?@
qu.1.10.comment=<p>Notice that each box has 2 $AskParity numbers. So there are 2 ways to draw the first number, and for each of these there are 2 ways to draw the second. This means there are 2*2 = 4 ways to draw an $AskParity number from each box.</p>@
qu.1.10.editing=useHTML@
qu.1.10.solution=@
qu.1.10.algorithm=$Q=25;
$S1=range(1,4,1);
$S1A=$S1+1;
$S1B=$S1+2;
$S1C=$S1+3;
$S2=range(8,11,1);
$S2A=$S2+1;
$S2B=$S2+2;
$S2C=$S2+3;
$AskParity=switch(rint(2),"odd","even");@
qu.1.10.uid=afe36b66-891f-4fd8-a624-2f135f11c835@
qu.1.10.info=  Course=202;
@

qu.2.topic=Permutations@

qu.2.1.mode=Multiple Choice@
qu.2.1.name=01+. Chocolate Bars@
qu.2.1.comment=<p>There are $n choices on the first run, $n-1 choices on the second run,  ...  $n-$p+1 choices on the $p$str run. Thus, there are <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'>$n</mi><mo lspace='0.0em' rspace='0.0em'>&sdot;</mo><mfenced open='(' close=')' separators=','><mrow><mi mathvariant='normal'>$n</mi><mo lspace='0.2222222em' rspace='0.2222222em'>&minus;</mo><mn>1</mn></mrow></mfenced><mo lspace='0.2222222em' rspace='0.0em'>..</mo><mo lspace='0.0em' rspace='0.0em'>&period;</mo><mfenced open='(' close=')' separators=','><mrow><mi mathvariant='normal'>$n</mi><mo lspace='0.2222222em' rspace='0.2222222em'>&minus;</mo><mi mathvariant='normal'>$p</mi><mo lspace='0.2222222em' rspace='0.2222222em'>&plus;</mo><mn>1</mn></mrow></mfenced><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mrow><mfrac><mrow><mi mathvariant='normal'>$n</mi><mo lspace='0.1111111em' rspace='0.0em'>&excl;</mo></mrow><mrow><mi mathvariant='normal'>$nmp</mi><mo lspace='0.1111111em' rspace='0.0em'>&excl;</mo></mrow></mfrac></mrow></mrow></mstyle></math> choices.</p>@
qu.2.1.editing=useHTML@
qu.2.1.solution=@
qu.2.1.algorithm=$Q="01+";
$Align=switch(rint(2),"Left","Right");
$Which=rint(4);
$n=range(4,9);
$p=range(3,$n-1);
$nmp = $n-$p;
$str = if(eq(p,3),"rd","th");@
qu.2.1.uid=af0dc3a5-ec30-4f9f-9617-21763c646075@
qu.2.1.info=  Difficulty=2;
  Keyword=multiplication principle;
  Course=230;
@
qu.2.1.question=<div title="UW Statistics Bank/Numerical Analysis/Counting Techniques/Combinations/Q$Q"><img align="$Align" src="__BASE_URI__NA/CT/Permutations//ChocolateBar$Which.gif" alt="Chocolate Bar" title="Chocolate Bar [IMG:ChocolateBar$Which.gif]" />A factory produces $n kinds of chocolate bars on the same assembly line. The line produces <font size="3" face="Times New Roman">$p</font> "runs" of bars a day. Each bar type is produced AT MOST for one run a day. How many different ways can the line be used if there are no restrictions on the sequence of bar types?</div>@
qu.2.1.answer=5@
qu.2.1.choice.1=<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'>$n</mi><mo lspace='0.1111111em' rspace='0.1111111em'>&excl;</mo><mo lspace='0.0em' rspace='0.0em'>&sdot;</mo><mi mathvariant='normal'>$p</mi><mo lspace='0.1111111em' rspace='0.1111111em'>&excl;</mo></mrow></mstyle></math>@
qu.2.1.choice.2=<font size="3" face="Times New Roman">$p!</font>@
qu.2.1.choice.3=<font size="3" face="Times New Roman">$n<sup>$p</sup></font>@
qu.2.1.choice.4=<font size="3" face="Times New Roman">$p<sup>$n</sup></font>@
qu.2.1.choice.5=<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 mathvariant='normal'>$n</mi><mo lspace='0.1111111em' rspace='0.1111111em'>&excl;</mo></mrow><mrow><mi mathvariant='normal'>$nmp</mi><mo lspace='0.1111111em' rspace='0.1111111em'>&excl;</mo></mrow></mfrac></mrow></mstyle></math>@
qu.2.1.fixed=@

qu.2.2.question=<div title="UW Statistics Bank/Numerical Analysis/Counting Techniques/Permutations/Q$Q">How many different pairs of people can you select from a group of $G persons, if the order of selection DOES matter? (That is selecting A then B is considered a different selection than selecting B then A.)</div>@
qu.2.2.answer.num=$Ans@
qu.2.2.answer.units=@
qu.2.2.showUnits=false@
qu.2.2.grading=exact_value@
qu.2.2.negStyle=minus@
qu.2.2.numStyle=thousands scientific dollars arithmetic@
qu.2.2.mode=Numeric@
qu.2.2.name=07+. Select two from a group@
qu.2.2.comment=<p>You can select the first person in $G ways, and the second in $GM1 so you can select two people in $G($GM1) = $Ans ways. Notice that every pair of persons is double-counted this way (that is both AB and BA are being counted) which is what we want to do if order matters.</p>@
qu.2.2.editing=useHTML@
qu.2.2.solution=@
qu.2.2.algorithm=$Q="07+";
$G=rint(4,13);
$GM1=$G-1;
$Ans=$G*($G-1);@
qu.2.2.uid=4cd7b3ee-1641-4cd1-a65a-23e07b6380be@
qu.2.2.info=  Course=230;
  Type=numeric;
@

qu.2.3.mode=Multiple Choice@
qu.2.3.name=05+. Spell Independent@
qu.2.3.comment=<p>Notice first of all that if all 11 letters were different, this question would be very easy:&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><mn>1</mn><mrow><mn>11</mn><mo lspace='0.1111111em' rspace='0.1111111em'>&excl;</mo></mrow></mfrac></mrow></mstyle></math> since there are 11! possible arrangements (choose the first letter 11 ways, then the second in 10 ways, ...) and only 1 of them spells the desired word. Our answer is just an extension of this. There are still 11! possible arrangements, but more than one of them spell our word, because some letters are repeated. For example there are 6 = 3! ways to place the 3 N's. (To see this, let's call them 1,2,3. Then the 6 ways are 123, 132, 213,231, 312, 321). The same holds for the E's and there are 2 = 2! ways to place the D's. Thus there are actually 3!3!2! possible ways to spell INDEPENDENT and 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><mn>3</mn><mo lspace='0.1111111em' rspace='0.1111111em'>&excl;</mo><mn>3</mn><mo lspace='0.1111111em' rspace='0.1111111em'>&excl;</mo><mn>2</mn><mo lspace='0.1111111em' rspace='0.1111111em'>&excl;</mo></mrow><mrow><mn>11</mn><mo lspace='0.1111111em' rspace='0.1111111em'>&excl;</mo></mrow></mfrac></mrow></mstyle></math>.</p>@
qu.2.3.editing=useHTML@
qu.2.3.solution=@
qu.2.3.algorithm=@
qu.2.3.uid=4121caf1-a67c-4ab1-b611-1d3923823e62@
qu.2.3.info=  Difficulty=2;
  Keyword=counting;
  Course=230;
  Type=MC;
  Algorithmic=no;
@
qu.2.3.question=<div title="UW Statistics Bank/Numerical Analysis/Counting Techniques/Permutations/Q05+">The letters of INDEPENDENT are arranged in a row at random. Find the probability that they spell INDEPENDENT.</div>@
qu.2.3.answer=3@
qu.2.3.choice.1=<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><mn>11</mn><mo lspace='0.1111111em' rspace='0.1111111em'>&excl;</mo></mrow></mfrac></mrow></mstyle></math>@
qu.2.3.choice.2=<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><mn>7</mn><mo lspace='0.1111111em' rspace='0.1111111em'>&excl;</mo></mrow></mfrac></mrow></mstyle></math>@
qu.2.3.choice.3=<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>3</mn><mo lspace='0.1111111em' rspace='0.1111111em'>&excl;</mo><mn>3</mn><mo lspace='0.1111111em' rspace='0.1111111em'>&excl;</mo><mn>2</mn><mo lspace='0.1111111em' rspace='0.1111111em'>&excl;</mo></mrow><mrow><mn>11</mn><mo lspace='0.1111111em' rspace='0.1111111em'>&excl;</mo></mrow></mfrac></mrow></mstyle></math>@
qu.2.3.choice.4=<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><mn>11</mn></mrow></mfrac></mrow></mstyle></math>@
qu.2.3.choice.5=<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>18</mn><mrow><mn>7</mn><mo lspace='0.1111111em' rspace='0.1111111em'>&excl;</mo></mrow></mfrac></mrow></mstyle></math>@
qu.2.3.fixed=@

qu.2.4.question=<div title="UW Statistics Bank/Numerical Analysis/Counting Techniques/Permutations/Q$Q">Suppose the letters of the word $W are rearranged to form 4 letter words such that none of the words repeat. If the results are arranged in ascending order (as in a dictionary) what is the rank of the word $W?</div>@
qu.2.4.answer.num=$Ans@
qu.2.4.answer.units=@
qu.2.4.showUnits=false@
qu.2.4.grading=exact_value@
qu.2.4.negStyle=minus@
qu.2.4.numStyle=thousands scientific dollars arithmetic@
qu.2.4.mode=Numeric@
qu.2.4.name=04. Rank the Word@
qu.2.4.comment=<img width="39" hspace="4" height="161" align="left" src="__BASE_URI__NA/CT/Permutations/WordList$Which.gif" alt="Word List" title="Word List [IMG:WordList$Which.gif]" />First determine how many unique variations there are - keeping in mind identical letters are indistinguishable. Here we have <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>4</mn><mo lspace='0.1111111em' rspace='0.0em'>&excl;</mo></mrow><mrow><mi mathvariant='normal'>$NumPermsDenom</mi></mrow></mfrac></mrow></mstyle></math> = $NumPerms such. You can list them exhaustively as shown. In some cases, depending on the word, it may be easier to logically determine the rank.@
qu.2.4.editing=useHTML@
qu.2.4.hint.1=<strong>Do NOT distinguish between identical letters. </strong>For example consider the word "WOOD". There is only one arrangement "OOWD" since we consider the "O"s indistinguishable.@
qu.2.4.hint.2=Make  as many unique "words" as you can using the letters in the word. (The "words" do not  have to make sense, ANY arrangement of the letters is a "word"). Arrange them in alphabetical  order. Where is the original word in the list, ie: is it the 10th word? The 100th? The  1000th?@
qu.2.4.hint.3=Consider the word "WOOD" . The arrangement "DOOW" is first alphabetically, so its rank is 1. The arrangement "DWOO" is 3rd alphabetically, so its rank is 3.@
qu.2.4.solution=@
qu.2.4.algorithm=$Q=4;
$Which=rint(4);
$W=switch($Which,"WOOD","DOOR","ODOR","DEED");
$Ans=switch($Which,12,1,4,3);
$NumPermsDenom=$switch($Which,"2!","2!","2!","2!2!");
$NumPerms=switch($Which,12,12,12,6);
$L0=("DOOW","DOWO","DW00","0D0W","ODWO","OODW","OOWD","OWDO","OWOD","WDOO","WODO","WOOD");
$L1=("DOOR","DORO","DR00","0D0R","ODRO","OODR","OORD","ORDO","OROD","RDOO","RODO","ROOD");
$L2=("DOOR","DORO","DR00","0D0R","ODRO","OODR","OORD","ORDO","OROD","RDOO","RODO","ROOD");
$L3=("DDEE","DEDE","DEED","EDDE","EDED","EEDD");@
qu.2.4.uid=8be27916-68cf-49a2-97e3-5aa9d05934b2@
qu.2.4.info=  Difficulty=3;
  Keyword=permute;
  Course=230;
  Type=numeric;
@

qu.2.5.mode=Multiple Choice@
qu.2.5.name=02+. How many have a digit occur?@
qu.2.5.comment=<p>The number of 3 digit numbers which have at least one of their digits $d can be found by subtracting those 3 digit numbers which do not have $d as one of their digits from all the 3 digit numbers. We know that the number of 3 digit numbers is 900. <br />
<br />
The number of 3 digit numbers that do not have $d as one of their digits can be found as follows:</p>
<ul>
    <li>The third (rightmost) digit of the number can be filled in 9 ways ($A1)</li>
    <li>The second digit of the number can be filled in 9 ways ($A1)</li>
    <li>The first digit of the number can be filled in 8 ways ($B)</li>
</ul>
<p><br />
Therefore, the number of 3 digit numbers that do not have $d as one of their digits = 8*9*9 = 648. Hence, The number of 3 digit number which have at least one of their digits being $d is 900 - 648 = 252.</p>@
qu.2.5.editing=useHTML@
qu.2.5.solution=@
qu.2.5.algorithm=$Q="02+";
$d=1+rint(9);
$Alt1=50+rint(100);
$Alt2=$Alt1+100;
$Alt3=253+rint(50);
$Alt4=$Alt3+37;
$B=if($d-1,if($d-9,"1 to 9,other than $d","1 to 8"),"2 to 9");
$A1=if($d-9,"0 to 9, other than $d","0 to 8");@
qu.2.5.uid=c694bd1d-0e50-463e-8f0d-b9c4c2bb8194@
qu.2.5.info=  Difficulty=3;
  Type=MC;
@
qu.2.5.question=<div title="UW Statistics Bank/Numerical Analysis/Counting Techniques/Permutations/Q$Q">How many numbers are there between 100 and 1000 such that at least one of their digits is $d?</div>@
qu.2.5.answer=1@
qu.2.5.choice.1=252@
qu.2.5.choice.2=$Alt1@
qu.2.5.choice.3=$Alt2@
qu.2.5.choice.4=$Alt3@
qu.2.5.choice.5=$Alt4@
qu.2.5.fixed=@

qu.2.6.question=<div title="UW Statistics Bank/Numerical Analysis/Counting Techniques/Permutations/Q$Q"><img width="50" hspace="3" height="50" align="right" alt="Number collection" title="Number collection [IMG:Numbers1.gif]" src="__BASE_URI__NA/CT/Permutations/Numbers1.gif" />Consider the numbers {$P1,$NP1,$P2,$NP2,$Fifth}. How many ways can I order these numbers if I must start the sequence with a non-prime?</div>@
qu.2.6.answer.num=$Ans@
qu.2.6.answer.units=@
qu.2.6.showUnits=false@
qu.2.6.grading=exact_value@
qu.2.6.negStyle=minus@
qu.2.6.numStyle=thousands scientific dollars arithmetic@
qu.2.6.mode=Numeric@
qu.2.6.name=03+. Reorder starting with ~prime.@
qu.2.6.comment=<p>There are $nnp non-primes, so there are $nnp ways to select the first number. That leaves 4 numbers to populate the remaining 4 spots which they can do 4 x 3 x 2 x 1 = 24 ways. The total number of ways to arrange the numbers then is $nnp x 24 = $Ans</p>@
qu.2.6.editing=useHTML@
qu.2.6.solution=@
qu.2.6.algorithm=$Q="03+";
$n=range(4,9,1);
$NP1=switch(rint(2),4,9);
$NP2=switch(rint(2),6,8);
$P1=switch(rint(2),7,11);
$P2=switch(rint(2),3,5);
$Fifth=switch(rint(4),12,13,14,17);
$Ans=maple("if type($Fifth,prime)then 48 else 72 end if");
$nnp=maple("if type($Fifth,prime)then 2 else 3 end if");@
qu.2.6.uid=286fefca-8698-494f-b2df-9b835054dace@
qu.2.6.info=  Diificulty=0;
  Type=numeric;
@

qu.2.7.question=<div title="UW Statistics Bank/Numerical Analysis/Counting Techniques/Permutations/Q$Q">The Statistics Survey Centre has a list of $n students whom are available for short-term survey work. How many ways can the Centre hire <strong>at least</strong> one of these students for a job?</div>@
qu.2.7.answer.num=$Ans@
qu.2.7.answer.units=@
qu.2.7.showUnits=false@
qu.2.7.grading=exact_value@
qu.2.7.negStyle=minus@
qu.2.7.numStyle=thousands scientific dollars arithmetic@
qu.2.7.mode=Numeric@
qu.2.7.name=06+. Ways to hire ≥ one student@
qu.2.7.comment=<p>Obviously the answer is (#ways to select 1 student) + (# ways to select 2  students) + ... + (# ways to select all students) <br />
<br />
You <span style="text-decoration: underline;">could</span> choose to do so, and  use combinations here:&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><mfenced open='(' close=')' separators=','><mtable rowalign='baseline' columnalign='center' groupalign='{left}' rowspacing='1.0ex'><mtr><mtd><mrow><mi mathvariant='normal'>$n</mi></mrow></mtd></mtr><mtr><mtd><mrow><mn>1</mn></mrow></mtd></mtr></mtable></mfenced></mrow><mrow><mo lspace='0.2222222em' rspace='0.2222222em'>&plus;</mo><mfenced open='(' close=')' separators=','><mrow><mtable rowalign='baseline' columnalign='center' groupalign='{left}' rowspacing='1.0ex'><mtr><mtd><mrow><mi mathvariant='normal'>$n</mi></mrow></mtd></mtr><mtr><mtd><mrow><mn>2</mn></mrow></mtd></mtr></mtable></mrow></mfenced><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><mfenced open='(' close=')' separators=','><mrow><mtable rowalign='baseline' columnalign='center' groupalign='{left}' rowspacing='1.0ex'><mtr><mtd><mrow><mi mathvariant='normal'>$n</mi></mrow></mtd></mtr><mtr><mtd><mrow><mi mathvariant='normal'>$n</mi></mrow></mtd></mtr></mtable></mrow></mfenced></mrow></mstyle></math>&nbsp; , however, this can be tedious in general.</p>
<p>Here's an easier way: for any group of n students, the way we can select a subset of any size is 2<sup>$n</sup>, since for each student we have two choices: select or don't select. That is: there are two actions with the first student, two with the second, etc. If you impose the restraint that at least one student from the group must be selected, that just removes one possibility -- the case where we do not choose any student at all -- so in that case the number of ways is 2<sup>$n</sup> - 1 = $Ans.</p>@
qu.2.7.editing=useHTML@
qu.2.7.solution=@
qu.2.7.algorithm=$Q="06+";
$n=range(5,14);
$Ans=(2^$n)-1;@
qu.2.7.uid=5e4907bc-9e73-44fd-8cd2-ccd4bba4dd4b@
qu.2.7.info=  Course=230;
  Type=numeric;
@

qu.3.topic=With Replacement@

qu.3.1.mode=Multiple Choice@
qu.3.1.name=01. # of n-letter "words"@
qu.3.1.comment=<p>An important fact to consider is that letters may be repeated any number of times, ex. YYYAA. Thus, there are $n choices for the first letter AND $n choices for the second letter AND $n choices for the third letter .....etc.</p>@
qu.3.1.editing=useHTML@
qu.3.1.solution=@
qu.3.1.algorithm=$Q=1;
$n=range(11,32);
$p=range(5,10);
$nmp= $n-$p;@
qu.3.1.uid=e6e1f189-1d8e-4ffe-8b15-65752039ac7d@
qu.3.1.info=  Difficulty=2;
  Course=230;
  Type=MC;
@
qu.3.1.question=<div title="UW Statistics Bank/Numerical Analysis/Counting Techniques/With Replacement/Q$Q"><img width="100" hspace="2" height="104" align="right" title="Letters [IMG:Letters.gif]" alt="Letters" src="__BASE_URI__NA/CT/WithReplacement/Letters.gif" /> A "word" is any string of letters, ex. RXZNP, TRT, VZAAVX. How many <font size="3" face="Times New Roman">$p</font> letter words can be formed using an alphabet containing <font size="3" face="Times New Roman">$n</font> letters? <strong>NOTE: </strong>There is no restriction on how many times a letter may be used in forming a "word".</div>@
qu.3.1.answer=2@
qu.3.1.choice.1=<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 mathvariant='normal'>$n</mi><mo lspace='0.1111111em' rspace='0.1111111em'>&excl;</mo></mrow><mrow><mi mathvariant='normal'>$nmp</mi><mo lspace='0.1111111em' rspace='0.1111111em'>&excl;</mo></mrow></mfrac></mrow></mstyle></math>@
qu.3.1.choice.2=<font size="3" face="Times New Roman">$n<sup>$p</sup></font>@
qu.3.1.choice.3=<font size="3" face="Times New Roman">$p<sup>$n</sup></font>@
qu.3.1.choice.4=<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 mathvariant='normal'>$n</mi><mo lspace='0.1111111em' rspace='0.1111111em'>&excl;</mo></mrow><mrow><mi mathvariant='normal'>$p</mi><mo lspace='0.1111111em' rspace='0.1111111em'>&excl;</mo></mrow></mfrac></mrow></mstyle></math>@
qu.3.1.choice.5=<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 mathvariant='normal'>$n</mi><mo lspace='0.1111111em' rspace='0.1111111em'>&excl;</mo></mrow><mrow><mi mathvariant='normal'>$p</mi><mo lspace='0.1111111em' rspace='0.1111111em'>&excl;</mo><mi mathvariant='normal'>$nmp</mi><mo lspace='0.1111111em' rspace='0.1111111em'>&excl;</mo></mrow></mfrac></mrow></mstyle></math>@
qu.3.1.fixed=@

qu.3.2.mode=Multiple Choice@
qu.3.2.name=04. # ways to hire 1+ 3rd/4th year.@
qu.3.2.comment=<p>For any set of n students, the number of ways we can select a subset of any size is 2<sup>n</sup>, since for each student we have two choices: select or don't select. That is, there are two actions with the first student, two with the second, etc.&nbsp;</p>
<p>If in addition we impose the restraint that at least one student from the group must be selected, that just removes one possibility -- the case where we do not choose any student at all -- so in that case the number of ways is 2<sup>n</sup> - 1.&nbsp;</p>
<p>Once we have determined this for each subset, just do the multiplication:</p>
<p># of ways to hire students = (#ways to select 2nd years)(# ways to select 3rd years)(# ways to select 4th years) = (2<sup>$s</sup>)(2<sup>$t</sup>-1)(2<sup>$f</sup>-1) = $Ans.</p>@
qu.3.2.editing=useHTML@
qu.3.2.solution=@
qu.3.2.algorithm=$Q=4;
$Which=rint(4);
$Align=switch(rint(2),"Left","Right");
$s=range(2,6,1);
$t=range(2,6,1);
$f=range(2,6,1);
$Ans=(2^$s)*(2^$t-1)*(2^$f-1);
$A=(2^$s)*(2^$t)*(2^$f);
$B=(2^$s-1)*(2^$t-1)*(2^$f-1);
$C=$Ans-1;
$D=(2^$s)*(2^$t)*(2^$f)-1;@
qu.3.2.uid=06e2f19f-7f17-4604-b0cf-5832ca3910ec@
qu.3.2.info=  Course=230;
  Type=MC;
@
qu.3.2.question=<div title="UW Statistics Bank/Numerical Analysis/Counting Techniques/With Replacement/Q$Q"><img hspace="4" align="$Align" src="__BASE_URI__NA/CT/WithReplacement/Students$Which.gif" title="Students [IMG:Students$Which.gif]" alt="Students" />The Statistics Survey Centre wishes to hire some undergraduates to help in a phone survey. On the call list are $s second-year students, $t third-year and $f fourth-year students. Policy is to always hire at least one third year and one fourth year student. Other than that as many students as are needed can be hired without restriction. How many different ways can a group of students be hired to work a survey?
<p>&nbsp;</p>
<p><em>(Note: You are being asked how many different groups could be hired, that is how many ways is it possible to select a group of students given the conditions?)</em></p>
</div>@
qu.3.2.answer=5@
qu.3.2.choice.1=$A@
qu.3.2.choice.2=$B@
qu.3.2.choice.3=$C@
qu.3.2.choice.4=$D@
qu.3.2.choice.5=$Ans@
qu.3.2.fixed=@

qu.3.3.question=<div title="UW Statistics Bank/Numerical Analysis/Counting Techniques/With Replacement/Q$Q">
The Statistics Survey Centre has a list of $ugrad undergraduate and $grad graduate students whom are available for short-term survey work. Whenever such work comes in the Centre must hire a graduate student as a supervisor for the survey team. How many ways can the Centre hire a team (that is one or more students) for a job?</div>@
qu.3.3.answer.num=$Ans@
qu.3.3.answer.units=@
qu.3.3.showUnits=false@
qu.3.3.grading=exact_value@
qu.3.3.negStyle=minus@
qu.3.3.numStyle=thousands scientific dollars arithmetic@
qu.3.3.mode=Numeric@
qu.3.3.name=02. # of ways to hire >= 1 grad.@
qu.3.3.comment=<p>For any set of n students, the number of ways we can select a subset of any size is 2<sup>n</sup>, since for each student we have two choices: select or don't select. That is: there are two actions with the first student, two with the second, etc.</p>
<p>If we also impose the restraint that at least one student from the group must be selected, that just removes one possibility -- the case where we do not choose any student at all -- so in that case the number of ways is 2<sup>n</sup> - 1.&nbsp;</p>
<p>Therefore, the total number of ways to hire the survey team is:</p>
<p>(#of ways to pick undergrads)(#of ways to pick grads) = (2<sup>$ugrad</sup>)(2<sup>$grad</sup>-1) = $Ans</p>@
qu.3.3.editing=useHTML@
qu.3.3.solution=@
qu.3.3.algorithm=$Q=2;
$ugrad=range(3,12);
$grad=range(3,12,1);
$Ans=(2^$ugrad)*(2^$grad-1);@
qu.3.3.uid=53c20f76-cd49-4796-8eed-28956815097a@
qu.3.3.info=  Course=230;
  Type=numeric;
@

qu.3.4.mode=Multiple Choice@
qu.3.4.name=03. How many ways to disembark?@
qu.3.4.comment=<p>Consider the $n passengers in sequence. The first has $p stations to choose from. Whatever choice they make, the second also has $p choices, and so on. Thus the number of ways is ($p)($p)...($p)&nbsp; ($n times) = $p<sup>$n</sup>.</p>@
qu.3.4.editing=useHTML@
qu.3.4.solution=@
qu.3.4.algorithm=$Q=3;
$Align=switch(rint(3),"Left","Right","AbsMiddle");
$Which=rint(4);
$n=range(6,12,1);
$p=range(5,9,1);
condition:not(eq($n,$p));@
qu.3.4.uid=8100478a-9503-45b4-927a-c05d7fad4e46@
qu.3.4.info=  Diificulty=2;
  Keyword=Multiplication Principle;
  Course=230;
@
qu.3.4.question=<div title="UW Statistics Bank/Numerical Analysis/Counting Techniques/With Replacement/Q$Q">Suppose $n passengers board a train <img vspace="2" hspace="4" align="$Align" title="Train [IMG:Train$Which.gif]" alt="Train" src="__BASE_URI__NA/CT/WithReplacement/Train$Which.gif" /> in Kitchener. On its way to Montreal the train will make stops at $p different stations (numbered Kitchener = 1, 2, .. .,$p = Montreal)&nbsp; where passengers may get off. Assuming passengers are equally likely to get off at any station, how many different ways can the passengers disembark?</div>@
qu.3.4.answer=2@
qu.3.4.choice.1=$n<sup>$p</sup>@
qu.3.4.choice.2=$p<sup>$n</sup>@
qu.3.4.choice.3=$n! * $p!@
qu.3.4.choice.4=$n!@
qu.3.4.choice.5=$p!@
qu.3.4.fixed=@

qu.4.topic=Without Replacement@

qu.4.1.question=<div title="UW Statistics Bank/Numerical Analysis/Counting Techniques/Without Replacement/Q$Q">Suppose the letters of the word $W are rearranged to form 4 letter words such that none of the words repeat. If the results are arranged in ascending order (as in a dictionary) what is the rank of the word $W?</div>@
qu.4.1.answer.num=$Ans@
qu.4.1.answer.units=@
qu.4.1.showUnits=false@
qu.4.1.grading=exact_value@
qu.4.1.negStyle=minus@
qu.4.1.numStyle=thousands scientific dollars arithmetic@
qu.4.1.mode=Numeric@
qu.4.1.name=01. Rank the Word@
qu.4.1.comment=<img hspace="4" align="left" src="__BASE_URI__NA/GP/WordList$Pick.gif" title="Word List [IMG:WordList$Pick.gif]" alt="Word List" />First determine how many unique variations there are - keeping in mind identical letters are indistinguishable. Here we have <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>4</mn><mo lspace='0.1111111em' rspace='0.1111111em'>&excl;</mo></mrow><mrow><mi>$NumPermsDenom</mi></mrow></mfrac><mo lspace='0.2777778em' rspace='0.2777778em'>&equals;</mo><mi>$NumPerms</mi></mrow></mstyle></math> such. You can list them exhaustively as shown. In some cases, depending on the word, it may be easier to logically determine the rank.</p>@
qu.4.1.editing=useHTML@
qu.4.1.hint.1=<strong>Do NOT distinguish between identical letters. </strong>For example consider the word "WOOD". There is only one arrangement "OOWD" since we consider the "O"s indistinguishable.@
qu.4.1.hint.2=Make  as many unique "words" as you can using the letters in the word. (The "words" do not  have to make sense, ANY arrangement of the letters is a "word"). Arrange them in alphabetical  order. Where is the original word in the list, ie: is it the 10th word? The 100th? The  1000th?@
qu.4.1.hint.3=Consider the word "WOOD" . The arrangement "DOOW" is first alphabetically, so its rank is 1. The arrangement "DWOO" is 3rd alphabetically, so its rank is 3.@
qu.4.1.solution=@
qu.4.1.algorithm=$Q=1;
$Pick=rint(4);
$W=switch($Pick,"WOOD","DOOR","ODOR","DEED");
$Ans=switch($Pick,12,1,4,3);
$NumPermsDenom=$switch($Pick,"2!","2!","2!","2!2!");
$NumPerms=switch($Pick,12,12,12,6);
$L0=("DOOW","DOWO","DW00","0D0W","ODWO","OODW","OOWD","OWDO","OWOD","WDOO","WODO","WOOD");
$L1=("DOOR","DORO","DR00","0D0R","ODRO","OODR","OORD","ORDO","OROD","RDOO","RODO","ROOD");
$L2=("DOOR","DORO","DR00","0D0R","ODRO","OODR","OORD","ORDO","OROD","RDOO","RODO","ROOD");
$L3=("DDEE","DEDE","DEED","EDDE","EDED","EEDD");@
qu.4.1.uid=9e41ad0b-8b90-4f7d-a30e-e25bfc0fcfea@
qu.4.1.info=  Difficulty=3;
  Keyword=permute;
  Type=numeric;
@

qu.4.2.mode=Inline@
qu.4.2.name=02. Picking socks@
qu.4.2.comment=<p>The total number of ways to select $NumPick socks from $NumSocks pairs of socks (that is $Total socks) 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=','><mtable rowalign='baseline' columnalign='center' groupalign='{left}' rowspacing='1.0ex'><mtr><mtd><mrow><mi mathvariant='normal'>$Total</mi></mrow></mtd></mtr><mtr><mtd><mrow><mi mathvariant='normal'>$NumPick</mi></mrow></mtd></mtr></mtable></mfenced></mrow></mstyle></math>. Now consider how many ways we can pick $NumPick socks <u>without</u> getting a pair. Number the pairs 1,2,...,$NumSocks. Then we want to select $NumPick of these numbers without replacement in&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><mfenced open='(' close=')' separators=','><mtable rowalign='baseline' columnalign='center' groupalign='{left}' rowspacing='1.0ex'><mtr><mtd><mrow><mi mathvariant='normal'>$NumSocks</mi></mrow></mtd></mtr><mtr><mtd><mrow><mi mathvariant='normal'>$NumPick</mi></mrow></mtd></mtr></mtable></mfenced></mrow></mstyle></math> ways. However each individual sock can also be selected in 2 ways, so this total must be multiplied by 2<sup>$NumPick</sup> .&nbsp; Notice now that what we are working out is how many ways to select the socks to get no pairs, we want the complement so the resulting answer comes by simplifying the expression:&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></mrow><mrow><mfrac><mrow><msup><mn>2</mn><mrow><mi mathvariant='normal'>$NumPick</mi></mrow></msup><mo lspace='0.0em' rspace='0.0em'>&sdot;</mo><mfenced open='(' close=')' separators=','><mtable rowalign='baseline' columnalign='center' groupalign='{left}' rowspacing='1.0ex'><mtr><mtd><mrow><mi mathvariant='normal'>$NumSocks</mi></mrow></mtd></mtr><mtr><mtd><mrow><mi mathvariant='normal'>$NumPick</mi></mrow></mtd></mtr></mtable></mfenced></mrow><mrow><mfenced open='(' close=')' separators=','><mrow><mtable rowalign='baseline' columnalign='center' groupalign='{left}' rowspacing='1.0ex'><mtr><mtd><mrow><mi mathvariant='normal'>$Total</mi></mrow></mtd></mtr><mtr><mtd><mrow><mi mathvariant='normal'>$NumPick</mi></mrow></mtd></mtr></mtable></mrow></mfenced></mrow></mfrac></mrow></mstyle></math></p>@
qu.4.2.editing=useHTML@
qu.4.2.solution=@
qu.4.2.algorithm=$Q = 2;
$Which=rint(5);
$Align=switch(rint(2),"Left","Right");
$Pick=rint(4);
$NumSocks=switch($Pick,8,8,9,6);
$Total=2*$NumSocks;
$NumSocksT=switch($Pick,"eight","eight","nine","six");
$NumPick=switch($Pick,6,5,6,4);
$NumPickT=switch($Pick,"six","five","six","four");
$Top=switch($Pick,111,23,157,17);
$Bot=switch($Pick,143,39,221,33);
$X=switch(5,8,8,9,6);
$Alt1T=37;
$Alt1B=$Bot;
$Alt2T=$Top;
$Alt2B=121;
$Alt3T=36;
$Alt3B=range(49,71,2);
$Alt4T=range(13,35,2);
$Alt4B=77;@
qu.4.2.uid=939dcd9d-fc70-49bd-96b9-2fcf06f339c4@
qu.4.2.info=  Course=230;
@
qu.4.2.weighting=1@
qu.4.2.numbering=alpha@
qu.4.2.part.1.name=sro_id_1@
qu.4.2.part.1.editing=useHTML@
qu.4.2.part.1.choice.5=<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'>$Alt4T</mi><mrow><mi mathvariant='normal'>$Alt4B</mi></mrow></mfrac></mrow></mstyle></math>@
qu.4.2.part.1.fixed=@
qu.4.2.part.1.choice.4=<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'>$Alt3T</mi><mrow><mi mathvariant='normal'>$Alt3B</mi></mrow></mfrac></mrow></mstyle></math>@
qu.4.2.part.1.question=null@
qu.4.2.part.1.choice.3=<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'>$Alt2T</mi><mrow><mi mathvariant='normal'>$Alt2B</mi></mrow></mfrac></mrow></mstyle></math>@
qu.4.2.part.1.choice.2=<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'>$Alt1T</mi><mrow><mi mathvariant='normal'>$Alt1B</mi></mrow></mfrac></mrow></mstyle></math>@
qu.4.2.part.1.choice.1=<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'>$Top</mi><mrow><mi mathvariant='normal'>$Bot</mi></mrow></mfrac></mrow></mstyle></math>@
qu.4.2.part.1.mode=Non Permuting Multiple Choice@
qu.4.2.part.1.display=vertical@
qu.4.2.part.1.answer=1@
qu.4.2.question=<div title="UW Statistics Bank/Numerical Analysis/Counting Techniques/Without Replacement/Q$Q"><img hspace="4" align="$Align" src="__BASE_URI__NA/CT/WithoutReplacement/Sock$Which.gif" alt="Socks" title="Socks [IMG:Sock$Which.gif]" />A drawer contains $NumSocksT different pairs of socks. If $NumPickT socks are taken at random and without replacement, compute the probability that there is at least one matching pair among these $NumPickT socks.<span>&nbsp;</span><1><span>&nbsp;</span><p>&nbsp;</p><div title="UW Statistics Bank/Probability/Pr/Q$Q">&nbsp;</div></div>@

qu.4.3.question=<div title="UW Statistics Bank/Numerical Analysis/Counting Techniques/Combinations/Q$Q">How many different pairs of people can you select from a group of $G persons, if the order of selection does not matter? (That is selecting A then B is considered the same as selecting B then A.)</div>@
qu.4.3.answer.num=$Ans@
qu.4.3.answer.units=@
qu.4.3.showUnits=false@
qu.4.3.grading=exact_value@
qu.4.3.negStyle=minus@
qu.4.3.numStyle=thousands scientific dollars arithmetic@
qu.4.3.mode=Numeric@
qu.4.3.name=01+. Select two from a group@
qu.4.3.comment=<p>You can select the first person in $G ways, and the second in $GM1 so you can select two people in $G($GM1) = $PreAns ways. HOWEVER the answer is actually $Ans since every pair of persons is double-counted this way (that is both AB and BA are being counted).</p>@
qu.4.3.editing=useHTML@
qu.4.3.solution=@
qu.4.3.algorithm=$Q="01+";
$G=rint(4,13);
$GM1=$G-1;
$PreAns=$G*($G-1);
$Ans=$PreAns/2;@
qu.4.3.uid=06bc0377-ed78-44f5-ab8d-760dd8d1a700@
qu.4.3.info=  Course=230;
  Type=numeric;
@

