######################################################################## ## DESCRIPTION ## A WeBWorK problem that asks students to find continuous probabilities based on the ## normal distribution. ## WeBWorK problem written by JoAnne Taormina, ## ENDDESCRIPTION ## ## KEYWORDS('normal distribution', 'mean', 'standard deviation', 'probability', 'continuous') ## ## Author('JoAnne Taormina') ## Institution('Nassau Community College') ######################################################################## DOCUMENT(); # This should be the first executable line in the problem. loadMacros( "PG.pl", "PGbasicmacros.pl", "PGchoicemacros.pl", "PGanswermacros.pl", "PGstatisticsmacros.pl", "PGnumericalmacros.pl", "weightedGrader.pl", "PGstandard.pl", "MathObjects.pl", ); install_weighted_grader(); TEXT(beginproblem()); $showPartialCorrectAnswers = 1; $mu = random(8,10,.01); $sigma = random(1,3,.01); $a = random(6,7,.1); $b = random(6,7,.1); while($a==$b) {$b = random(6,7,.1);} $c = random(7.5,11,.01); $d = random(7,9,.1); $e = random(10,40,.1); $sample = random(100, 900, 50); $ans1 = normal_prob("-infty", $a, mean=>$mu, deviation=>$sigma); # round $ans1 to 4 decimal places $ans1 = int(10000*$ans1+.5*($ans1 <=> 0))/10000; $ans1 = $ans1 * 100; $ans1 = Compute($ans1); $ans2 = normal_prob($b, $c, mean=>$mu, deviation=>$sigma); # round $ans2 to 4 decimal places $ans2 = int(10000*$ans2+.5*($ans2 <=> 0))/10000; $ans2 = $ans2 * 100; $ans2 = Compute($ans2); $ans3 = normal_prob($d, "infty", mean=>$mu, deviation=>$sigma); # round $ans3 to 4 decimal places $ans3 = int(10000*$ans3+.5*($ans3 <=> 0))/10000; $ans3 = $ans3 * 100; $ans3 = Compute($ans3); $ztmp = normal_distr((50-$e)/100); $ans4 = $mu + ($ztmp*$sigma); # round $ans4 to nearest hundredth $ans4 = int(100*$ans4+.5*($ans4 <=> 0))/100; $ans4 = Compute($ans4); $ans5 = normal_prob($c, "infty", mean=>$mu, deviation=>$sigma) * $sample; # round $ans5 to nearest whole number $ans5 = int(1*$ans5+.5*($ans5 <=> 0))/1; $ans5 = Compute($ans5); $ans6 = (-1) * normal_distr(.25); $ans6 = $mu + ($ans6*$sigma); # round $ans6 to nearest hundredth $ans6 = int(100*$ans6+.5*($ans6 <=> 0))/100; $ans6 = Compute($ans6); BEGIN_TEXT Using diaries for many weeks, a study on the lifestyles of visually impaired students was conducted. The students kept track of many lifestyle variables including how many hours of sleep obtained on a typical day. Researchers found that visually impaired students averaged \($mu\) hours of sleep, with a standard deviation of \($sigma\) hours. Assume that the number of hours of sleep for these visually impaired students is normally distributed. $PAR (a) \( \) What is the probability that a visually impaired student gets at most \($a\) hours of sleep? $BITALIC Express your answer as a percent rounded to 2 decimal places. e.g. 1.23% $BBOLD Do not include the % symbol in your answer. $EBOLD $EITALIC $PAR Answer: \{ans_rule(10) \}% $PAR (b) \( \) What is the probability that a visually impaired student gets between \($b\) and \($c\) hours of sleep? $BITALIC Express your answer as a percent rounded to 2 decimal places. e.g. 1.23% $BBOLD Do not include the % symbol in your answer. $EBOLD $EITALIC $PAR Answer: \{ans_rule(10) \}% $PAR (c) \( \) What is the probability that a visually impaired student gets at least \($d\) hours of sleep? $BITALIC Express your answer as a percent rounded to 2 decimal places. e.g. 1.23% $BBOLD Do not include the % symbol in your answer. $EBOLD $EITALIC $PAR Answer: \{ans_rule(10) \}% $PAR (d) \( \) What is the sleep time that cuts off the top \($e%\) of sleep hours? $BITALIC Round your answer to 2 decimal places. $EITALIC $PAR Answer: \{ans_rule(10)\} hours $PAR (e) \( \) If $sample visually impaired students were studied, how many students would you expect to have sleep times of more than $c hours? $BITALIC Round to the nearest whole number. $EITALIC $PAR Answer: \{ans_rule(10)\} students $PAR (f) \( \) A school district wants to give additional assistance to visually impaired students with sleep times at the first quartile and lower. What would be the maximum sleep time to be recommended for additional assistance? $BITALIC Round your answer to 2 decimal places. $EITALIC $PAR Answer: \{ans_rule(10)\} hours $PAR END_TEXT Context("Numeric"); Context()->flags->set( tolerance=>0.002, tolType=>"absolute" ); WEIGHTED_ANS($ans1->cmp(), 10); WEIGHTED_ANS($ans2->cmp(), 15); WEIGHTED_ANS($ans3->cmp(), 15); WEIGHTED_ANS($ans4->cmp(), 20); Context()->flags->set( tolerance=>0, tolType=>"absolute" ); WEIGHTED_ANS($ans5->cmp(), 20); Context()->flags->set( tolerance=>0.002, tolType=>"absolute" ); WEIGHTED_ANS($ans6->cmp(), 20); ENDDOCUMENT(); # This should be the last executable line in the problem.