|
| 1 | +# DESCRIPTION |
| 2 | +# A problem that asks students to ... |
| 3 | +# |
| 4 | +# This problem is derived from a homework problem in Introductory Statistics, |
| 5 | +# licensed by OpenStax under a Creative Commons Attribution License (CC BY 4.0). |
| 6 | +# Modified for WeBWorK by Michael Stassen mstassen(at)fitchburgstate(dot)edu |
| 7 | +# ENDDESCRIPTION |
| 8 | + |
| 9 | +## DBsubject(Probability) |
| 10 | +## DBchapter(Sample Space) |
| 11 | +## DBsection(Probability: direct computation, inclusion/exclusion) |
| 12 | +## Institution(Fitchburg State University) |
| 13 | +## Author(Rachael Norton) |
| 14 | + |
| 15 | +DOCUMENT(); |
| 16 | +loadMacros( |
| 17 | + "PGstandard.pl", "PGML.pl", |
| 18 | + "contextPercent.pl", "niceTables.pl", |
| 19 | + 'contextFraction.pl', 'PGcourse.pl' |
| 20 | +); |
| 21 | + |
| 22 | +Context("Percent"); |
| 23 | + |
| 24 | +$cupchocolate = random(16, 24); |
| 25 | +$conechocolate = random(76, 84); |
| 26 | +$cupvanilla = random(2, 8); |
| 27 | +$conevanilla = random(11, 19); |
| 28 | +$cupswirl = random(11, 19); |
| 29 | +$coneswirl = random(60, 70); |
| 30 | +$cupstrawberry = random(1, 5); |
| 31 | +$conestrawberry = random(8, 16); |
| 32 | + |
| 33 | +$cup = $cupchocolate + $cupvanilla + $cupswirl + $cupstrawberry; |
| 34 | +$cone = $conechocolate + $conevanilla + $coneswirl + $conestrawberry; |
| 35 | +$chocolate = $cupchocolate + $conechocolate; |
| 36 | +$vanilla = $cupvanilla + $conevanilla; |
| 37 | +$swirl = $cupswirl + $coneswirl; |
| 38 | +$strawberry = $cupstrawberry + $conestrawberry; |
| 39 | + |
| 40 | +$total = $cup + $cone; |
| 41 | + |
| 42 | +BEGIN_PGML |
| 43 | +A soft-serve ice cream shop sold [$total] ice creams in a day. The following |
| 44 | +table identifies the ice creams they sold by flavor and whether they were |
| 45 | +served in a cup or cone. Fill in the missing values. |
| 46 | + |
| 47 | +[@ DataTable( |
| 48 | + [ |
| 49 | + ['Flavor', 'Chocolate', 'Vanilla', 'Swirl', 'Strawberry', 'Total'], |
| 50 | + ['Cup', $cupchocolate, PGML('[____]{$cupvanilla}'), $cupswirl, $cupstrawberry, $cup], |
| 51 | + ['Cone', $conechocolate, $conevanilla, PGML('[____]{$coneswirl}'), $conestrawberry, PGML('[____]{$cone}')], |
| 52 | + ['Total', PGML('[____]{$chocolate}'), $vanilla, PGML('[____]{$swirl}'), PGML('[____]{$strawberry}'), PGML('[____]{$total}')], |
| 53 | + ], |
| 54 | + padding => [0.5, 0.5], |
| 55 | + align => '|c|c|c|c|c|c|', |
| 56 | + horizontalrules => 1) |
| 57 | +@]* |
| 58 | + |
| 59 | +a) What is the probability that a randomly selected ice cream was served in a cup? [____]{$cup/$total} |
| 60 | +b) What is the probability that a randomly selected ice cream was either chocolate or swirl? [____]{($chocolate+$swirl)/$total} |
| 61 | +c) What is the probability that a randomly selected ice cream was chocolate served in a cup? [____]{$cupchocolate/$total} |
| 62 | +d) What is the probability that a randomly selected ice cream was strawberry, given that it was served in a cone? [____]{$conestrawberry/$cone} |
| 63 | +e) What is the probability that a randomly selected ice cream was not chocolate? [____]{($total-$chocolate)/$total} |
| 64 | +END_PGML |
| 65 | + |
| 66 | +ENDDOCUMENT(); |
0 commit comments