DOCUMENT(); loadMacros("PGstandard.pl", "PGnauStats.pl" ); TEXT(beginproblem()); $low = random (130, 180,1); $high = random (330, 380,1); $range = $high - $low; push @dat, $low; push @dat, int random($low + $range/5, $low + $range/4,1); push @dat, int random($low + $range/3, $high - $range/3,1); push @dat, int random($high - $range/4,$high - $range/5,1); push @dat, $high; $graph = BoxPlot(@dat); @slice = NchooseK(4,2); $offset = random (0,1,1); @slice = num_sort(@slice); $diff = $slice[1] - $slice[0]; $ans = $diff*25; $from = "\(\~~$$dat[$slice[0] + $offset],000\)"; $to = "\(\~~$$dat[$slice[1] + $offset],000\)"; $mc = new_multiple_choice(); $mc->qa("", "\($ans% \)"); for ($i = 0; $i < 5; $i++){ do { $rnd = random(5,95,5); } while ($rnd == $ans); push @other, "\($rnd%\)"; } $mc->extra(@other[NchooseK(5,3)]); $mc->makeLast("None of the Above"); BEGIN_TEXT $PAR The boxplot below represents the price for a house in Cavan-Monaghan, just outside of Peterborough. What percentage of the houses in this market are between $from and $to? \{$mc -> print_q \} $BR \{$mc -> print_a \} $BR \{Plot($graph, tex_size=>900); \} $PAR $BR END_TEXT ANS(str_cmp($mc->correct_ans)); ENDDOCUMENT();