######################################################################## ## DESCRIPTION ## A WeBWorK problem that asks students construct a probability distribution and answer questions on it. ## WeBWorK problem written by JoAnne Taormina, ## ENDDESCRIPTION ## ## KEYWORDS('probability distribution', 'discrete') ## ## Author('JoAnne Taormina') ## Institution('Nassau Community College') ######################################################################## DOCUMENT(); loadMacros( "PGstandard.pl", "MathObjects.pl", "PGgraphmacros.pl", "weightedGrader.pl", ); TEXT(beginproblem()); # make sure we're in the context we want Context("Numeric"); Context()->strings->add(yy=>{},yb=>{},yr=>{},by=>{},bb=>{},br=>{},ry=>{},rb=>{},rr=>{}); $outcomes = List(Compute("yy"),Compute("yb"),Compute("yr"),Compute("by"),Compute("bb"),Compute("br"),Compute("ry"),Compute("rb"),Compute("rr")); $roots = List( -3, -2 ); # the table data $table_start = begintable(2); $table_row[0] = row( "X", "P(X)"); for ( $i = 1; $i <=3; $i++ ) { $table_row[$i] = row( ans_rule(5), ans_rule(5)); } $table_end = endtable(); $value_X_0 = Compute("0"); $value_X_1 = Compute("1"); $value_X_2 = Compute("2"); $prob_X_0 = Compute("4/9"); $prob_X_1 = Compute("4/9"); $prob_X_2 = Compute("1/9"); $ans_c = Compute("1/9"); $ans_d = Compute("5/9"); $ans_e = Compute("8/9"); $ans_f = Compute("4/9"); $ans_g = Compute("1/9"); Context()->texStrings; BEGIN_TEXT $BCENTER \{ image( "spinner_image.png" , width=>250, height=>250) \} $BR $BR $ECENTER $BR$BR Consider spinning a three colored spinner like the one shown here. Each color has the same portion of area. We’ll symbolize the color $BBOLD blue $EBOLD with the the letter $BBOLD b $EBOLD, the color $BBOLD red $EBOLD with the letter $BBOLD r $EBOLD, and the color $BBOLD yellow $EBOLD with the letter $BBOLD y $EBOLD. $BR$BR (a) On paper, construct a tree diagram for spinning the spinner $BBOLD twice. $EBOLD $BR$BR $BITALIC (Hint, there are 9 outcomes, and the order of the letters is important.) $EITALIC $BR$BR Write all 9 outcomes using the correct letters, separating each outcome with a comma “,”. For example, you should type $BBOLD bb, br $EBOLD to indicate the outcomes $BBOLD “blue blue” $EBOLD and $BBOLD “blue red.” $EBOLD $BR$BR Outcomes = \{ ans_rule(40) \} $BR $PAR (b) Construct a probability distribution table for the $BBOLD number of yellows $EBOLD in two spins of this 3-colored spinner. Leave probabilities as fractions, e.g. 1/2 instead of 50%. $BR$BR $BCENTER $table_start $table_row[0] $table_row[1] $table_row[2] $table_row[3] $table_end $ECENTER $PAR Use the probability distribution table in part (b) to answer the following questions: $BR$BR (c) What is the probability of getting 2 yellows in two spins of the spinner? Answer as a fraction. \{ ans_rule(5) \} $BR$BR (d) What is the probability of getting $BBOLD $BITALIC at least 1 $EBOLD $EITALIC yellow in two spins of the spinner? Answer as a fraction. \{ ans_rule(5) \} $BR$BR (e) What is the probability of getting $BBOLD $BITALIC at most 1 $EBOLD $EITALIC yellow in two spins of the spinner? Answer as a fraction. \{ ans_rule(5) \} $BR$BR (f) What is the probability of getting $BBOLD $BITALIC less than 1 $EBOLD $EITALIC yellow in two spins of the spinner? Answer as a fraction. \{ ans_rule(5) \} $BR$BR (g) What is the probability of getting $BBOLD $BITALIC more than 1 $EBOLD $EITALIC yellow in two spins of the spinner? Answer as a fraction. \{ ans_rule(5) \} END_TEXT Context()->normalStrings; WEIGHTED_ANS( $value_X_0->cmp(),4 ); WEIGHTED_ANS( $prob_X_0->cmp(),6 ); WEIGHTED_ANS( $value_X_1->cmp(),4 ); WEIGHTED_ANS( $prob_X_1->cmp(),6 ); WEIGHTED_ANS( $value_X_2->cmp(),4 ); WEIGHTED_ANS( $prob_X_2->cmp(),6 ); WEIGHTED_ANS( $outcomes->cmp(),10 ); WEIGHTED_ANS( $ans_c->cmp(),8 ); WEIGHTED_ANS( $ans_d->cmp(),13 ); WEIGHTED_ANS( $ans_e->cmp(),13 ); WEIGHTED_ANS( $ans_f->cmp(),13 ); WEIGHTED_ANS( $ans_g->cmp(),13 ); ENDDOCUMENT();